feat: backend executor implement
This commit is contained in:
@@ -40,40 +40,46 @@ type Mount struct {
|
||||
|
||||
// ContainerSpec contains every property controlled by the backend executor.
|
||||
type ContainerSpec struct {
|
||||
Name string
|
||||
ImageReference string
|
||||
Platform Platform
|
||||
Environment []string
|
||||
Labels map[string]string
|
||||
NetworkMode string
|
||||
RestartPolicy RestartPolicy
|
||||
Mounts []Mount
|
||||
Name string
|
||||
ImageReference string
|
||||
Platform Platform
|
||||
Environment []string
|
||||
Labels map[string]string
|
||||
NetworkMode string
|
||||
RestartPolicy RestartPolicy
|
||||
Mounts []Mount
|
||||
User string
|
||||
StopTimeoutSeconds int
|
||||
}
|
||||
|
||||
// Container is the runtime state required for idempotent inspection.
|
||||
type Container struct {
|
||||
ID string
|
||||
Name string
|
||||
ImageID string
|
||||
ImageReference string
|
||||
Platform string
|
||||
Running bool
|
||||
Dead bool
|
||||
Status string
|
||||
Environment []string
|
||||
Labels map[string]string
|
||||
NetworkMode string
|
||||
RestartPolicy RestartPolicy
|
||||
Mounts []Mount
|
||||
ID string
|
||||
Name string
|
||||
ImageID string
|
||||
ImageReference string
|
||||
Platform string
|
||||
Running bool
|
||||
Dead bool
|
||||
Status string
|
||||
Environment []string
|
||||
Labels map[string]string
|
||||
NetworkMode string
|
||||
RestartPolicy RestartPolicy
|
||||
Mounts []Mount
|
||||
User string
|
||||
StopTimeoutSeconds int
|
||||
}
|
||||
|
||||
// Engine is the smallest container runtime API required by an update executor.
|
||||
type Engine interface {
|
||||
Ping(context.Context) error
|
||||
PullImage(context.Context, string) error
|
||||
LoadImage(context.Context, io.Reader) error
|
||||
InspectImage(context.Context, string) (Image, error)
|
||||
CreateContainer(context.Context, ContainerSpec) (Container, error)
|
||||
StartContainer(context.Context, string) error
|
||||
StopContainer(context.Context, string) error
|
||||
InspectContainer(context.Context, string) (Container, error)
|
||||
RemoveContainer(context.Context, string, bool) error
|
||||
Close() error
|
||||
|
||||
Reference in New Issue
Block a user