2015-12-01 19:56:08 +00:00
|
|
|
package runtime
|
2015-11-05 23:29:53 +00:00
|
|
|
|
2015-12-01 20:00:11 +00:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/opencontainers/specs"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
ErrNotChildProcess = errors.New("containerd: not a child process for container")
|
|
|
|
ErrInvalidContainerType = errors.New("containerd: invalid container type for runtime")
|
2015-12-04 22:00:07 +00:00
|
|
|
ErrCheckpointNotExists = errors.New("containerd: checkpoint does not exist for container")
|
2015-12-04 22:10:50 +00:00
|
|
|
ErrCheckpointExists = errors.New("containerd: checkpoint already exists")
|
2015-12-08 18:04:31 +00:00
|
|
|
ErrContainerExited = errors.New("containerd: container has exited")
|
2015-12-01 20:00:11 +00:00
|
|
|
)
|
2015-11-10 22:57:10 +00:00
|
|
|
|
2015-12-08 18:04:31 +00:00
|
|
|
// Runtime handles containers, containers handle their own actions
|
2015-11-05 23:29:53 +00:00
|
|
|
type Runtime interface {
|
2015-12-08 18:04:31 +00:00
|
|
|
// Create creates a new container initialized but without it starting it
|
2015-11-13 21:22:42 +00:00
|
|
|
Create(id, bundlePath string, stdio *Stdio) (Container, error)
|
2015-12-08 18:04:31 +00:00
|
|
|
// StartProcess adds a new process to the container
|
2015-11-13 21:22:42 +00:00
|
|
|
StartProcess(Container, specs.Process, *Stdio) (Process, error)
|
2015-12-08 17:37:31 +00:00
|
|
|
Type() string
|
2015-11-05 23:29:53 +00:00
|
|
|
}
|