containerd/runtime/runtime.go

27 lines
1,018 B
Go
Raw Normal View History

package runtime
2015-11-05 23:29:53 +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")
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")
)
// Runtime handles containers, containers handle their own actions
2015-11-05 23:29:53 +00:00
type Runtime interface {
// Type of the runtime
Type() string
// Create creates a new container initialized but without it starting it
Create(id, bundlePath, consolePath string) (Container, *IO, error)
// StartProcess adds a new process to the container
StartProcess(c Container, p specs.Process, consolePath string) (Process, *IO, error)
2015-11-05 23:29:53 +00:00
}