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 (
|
2015-12-11 01:07:21 +00:00
|
|
|
ErrNotChildProcess = errors.New("containerd: not a child process for container")
|
|
|
|
ErrInvalidContainerType = errors.New("containerd: invalid container type for runtime")
|
|
|
|
ErrCheckpointNotExists = errors.New("containerd: checkpoint does not exist for container")
|
|
|
|
ErrCheckpointExists = errors.New("containerd: checkpoint already exists")
|
|
|
|
ErrContainerExited = errors.New("containerd: container has exited")
|
|
|
|
ErrTerminalsNotSupported = errors.New("containerd: terminals are not supported for runtime")
|
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-11 01:07:21 +00:00
|
|
|
// Type of the runtime
|
|
|
|
Type() string
|
2015-12-08 18:04:31 +00:00
|
|
|
// Create creates a new container initialized but without it starting it
|
2015-12-15 00:47:42 +00:00
|
|
|
Create(id, bundlePath, consolePath string) (Container, *IO, error)
|
2015-12-08 18:04:31 +00:00
|
|
|
// StartProcess adds a new process to the container
|
2015-12-15 19:43:51 +00:00
|
|
|
StartProcess(c Container, p specs.Process, consolePath string) (Process, *IO, error)
|
2015-11-05 23:29:53 +00:00
|
|
|
}
|