Versions in this module Expand all Collapse all v1 v1.4.4 Mar 5, 2021 Changes in this version + const TaskCheckpointedEventTopic + const TaskCreateEventTopic + const TaskDeleteEventTopic + const TaskExecAddedEventTopic + const TaskExecStartedEventTopic + const TaskExitEventTopic + const TaskOOMEventTopic + const TaskPausedEventTopic + const TaskResumedEventTopic + const TaskStartEventTopic + const TaskUnknownTopic + var ErrTaskAlreadyExists = errors.New("task already exists") + var ErrTaskNotExists = errors.New("task does not exist") + type ConsoleSize struct + Height uint32 + Width uint32 + type CreateOpts struct + Checkpoint string + IO IO + Rootfs []mount.Mount + Runtime string + RuntimeOptions *types.Any + Spec *types.Any + TaskOptions *types.Any + type ExecOpts struct + IO IO + Spec *types.Any + type Exit struct + Pid uint32 + Status uint32 + Timestamp time.Time + type IO struct + Stderr string + Stdin string + Stdout string + Terminal bool + type PlatformRuntime interface + Add func(context.Context, Task) error + Create func(ctx context.Context, id string, opts CreateOpts) (Task, error) + Delete func(context.Context, string) + Get func(context.Context, string) (Task, error) + ID func() string + Tasks func(context.Context, bool) ([]Task, error) + type Process interface + CloseIO func(context.Context) error + Delete func(context.Context) (*Exit, error) + ID func() string + Kill func(context.Context, uint32, bool) error + ResizePty func(context.Context, ConsoleSize) error + Start func(context.Context) error + State func(context.Context) (State, error) + Wait func(context.Context) (*Exit, error) + type ProcessInfo struct + Info interface{} + Pid uint32 + type State struct + ExitStatus uint32 + ExitedAt time.Time + Pid uint32 + Status Status + Stderr string + Stdin string + Stdout string + Terminal bool + type Status int + const CreatedStatus + const DeletedStatus + const PausedStatus + const PausingStatus + const RunningStatus + const StoppedStatus + type Task interface + Checkpoint func(context.Context, string, *types.Any) error + Exec func(context.Context, string, ExecOpts) (Process, error) + Namespace func() string + PID func() uint32 + Pause func(context.Context) error + Pids func(context.Context) ([]ProcessInfo, error) + Process func(context.Context, string) (Process, error) + Resume func(context.Context) error + Stats func(context.Context) (*types.Any, error) + Update func(context.Context, *types.Any) error + type TaskInfo struct + ID string + Namespace string + Runtime string + Spec []byte + type TaskList struct + func NewTaskList() *TaskList + func (l *TaskList) Add(ctx context.Context, t Task) error + func (l *TaskList) AddWithNamespace(namespace string, t Task) error + func (l *TaskList) Delete(ctx context.Context, id string) + func (l *TaskList) Get(ctx context.Context, id string) (Task, error) + func (l *TaskList) GetAll(ctx context.Context, noNS bool) ([]Task, error) + type TaskMonitor interface + Monitor func(Task) error + Stop func(Task) error + func NewMultiTaskMonitor(monitors ...TaskMonitor) TaskMonitor + func NewNoopMonitor() TaskMonitor