Documentation
¶
Overview ¶
The Task: Is the smallest unit of work in an Orchestration system and typically runs in a container.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
AttachStderr bool
AttachStdin bool
AttachStdout bool
Cmd []string
Disk int64
Env []string
Image string
Memory int64
Name string
RestartPolicy string // Accepted values: always, unless-stopped, on-failure and empty.
}
Config: The Config type represents the configuration for orchestration tasks.
type Docker ¶
type Docker struct {
Client DockerApi
Config Config
ContainerId string
// contains filtered or unexported fields
}
Docker: The Docker type will encapsulate everything we need to run a task in a container.
func (*Docker) Run ¶
func (d *Docker) Run() DockerResult
Run: The Run function runs a task in a container.
type DockerApi ¶
type DockerApi interface {
ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.CreateResponse, error)
ContainerStart(ctx context.Context, id string, opts types.ContainerStartOptions) error
ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error)
}
DockerApi: The DockerApi type represents the interface for the Docker API.
type DockerResult ¶
DockerResult: The DockerResult type represents the result of running a task in a container.
type State ¶
type State int
State: The State type represents the states a task goes through, from Pending to Scheduled to Running to Completed or Failed.
Click to show internal directories.
Click to hide internal directories.