2016-12-02 23:37:16 +00:00
|
|
|
package execution
|
|
|
|
|
2016-12-05 22:15:03 +00:00
|
|
|
import (
|
2016-12-09 18:00:30 +00:00
|
|
|
"context"
|
2016-12-05 22:15:03 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/opencontainers/runtime-spec/specs-go"
|
|
|
|
)
|
2016-12-02 23:37:16 +00:00
|
|
|
|
|
|
|
type CreateOpts struct {
|
2016-12-09 17:17:34 +00:00
|
|
|
Bundle string
|
|
|
|
Console bool
|
|
|
|
Stdin string
|
|
|
|
Stdout string
|
|
|
|
Stderr string
|
2016-12-02 23:37:16 +00:00
|
|
|
}
|
|
|
|
|
2016-12-09 17:17:34 +00:00
|
|
|
type StartProcessOpts struct {
|
2016-12-14 17:16:23 +00:00
|
|
|
ID string
|
2016-12-09 17:17:34 +00:00
|
|
|
Spec specs.Process
|
|
|
|
Console bool
|
|
|
|
Stdin string
|
|
|
|
Stdout string
|
|
|
|
Stderr string
|
2016-12-05 22:15:03 +00:00
|
|
|
}
|
|
|
|
|
2016-12-02 23:37:16 +00:00
|
|
|
type Executor interface {
|
2016-12-09 18:00:30 +00:00
|
|
|
Create(ctx context.Context, id string, o CreateOpts) (*Container, error)
|
|
|
|
Pause(context.Context, *Container) error
|
|
|
|
Resume(context.Context, *Container) error
|
|
|
|
Status(context.Context, *Container) (Status, error)
|
|
|
|
List(context.Context) ([]*Container, error)
|
|
|
|
Load(ctx context.Context, id string) (*Container, error)
|
|
|
|
Delete(context.Context, *Container) error
|
|
|
|
Start(context.Context, *Container) error
|
2016-12-05 22:15:03 +00:00
|
|
|
|
2016-12-09 18:00:30 +00:00
|
|
|
StartProcess(context.Context, *Container, StartProcessOpts) (Process, error)
|
|
|
|
SignalProcess(ctx context.Context, c *Container, id string, sig os.Signal) error
|
|
|
|
DeleteProcess(ctx context.Context, c *Container, id string) error
|
2016-12-02 23:37:16 +00:00
|
|
|
}
|