Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildContainerLogChannel ¶
func BuildContainerLogChannel(ctx context.Context, client *client.Client, containerID string) (<-chan string, error)
BuildContainerLogChannel accepts a pointer to a Docker client.Client and a container ID and returns a string channel that provides all events from the container's standard output and error streams.
func BuildContainerLogChannels ¶
func BuildContainerLogChannels(ctx context.Context, client *client.Client, containerID string) (stdout, stderr <-chan string, err error)
BuildContainerLogChannels accepts a pointer to a Docker client.Client and a container ID and returns tww string channels, one that provides all events emitted by the container's standard output stream, and a second for standard error.
Types ¶
type Worker ¶
type Worker struct { Command data.CommandRequest CommandParameters []string DockerClient *client.Client DockerHost string EntryPoint []string ExitStatus chan int64 ExecutionTimeout time.Duration ImageName string Token rest.Token // contains filtered or unexported fields }
Worker represents a container executor. It has a lifetime of a single command execution.
func (*Worker) Start ¶
Start triggers a worker to run a container according to its settings. It returns a string channel that emits the container's combined stdout and stderr streams.
func (*Worker) Stop ¶
Cleanup will stop (if it's not already stopped) a worker process and cleanup any resources it's using. If the worker fails to stop gracefully within a timeframe specified by the timeout argument, it is forcefully terminated (killed). If the timeout is nil, the engine's default is used. A negative timeout indicates no timeout: no forceful termination is performed.