Add exec APIs

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-04-05 11:51:56 -07:00
parent cccf5d3723
commit 7715ddcefa
19 changed files with 759 additions and 126 deletions

View File

@@ -23,12 +23,25 @@ type LinuxContainer interface {
Pause(context.Context) error
Resume(context.Context) error
Exec(context.Context, ExecOpts) (Process, error)
}
type ContainerStatus int
type ExecOpts struct {
Spec []byte
IO IO
}
type Process interface {
// State returns the process state
State(context.Context) (State, error)
// Kill signals a container
Kill(context.Context, uint32, bool) error
}
type Status int
const (
CreatedStatus ContainerStatus = iota + 1
CreatedStatus Status = iota + 1
RunningStatus
StoppedStatus
DeletedStatus
@@ -37,7 +50,7 @@ const (
type State interface {
// Status is the current status of the container
Status() ContainerStatus
Status() Status
// Pid is the main process id for the container
Pid() uint32
}