worker

package
v0.4.0-dev.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

type Worker struct {
	CommandParameters []string
	DockerClient      *client.Client
	DockerContext     context.Context
	DockerHost        string
	EntryPoint        string
	ExitStatus        chan int64
	ExecutionTimeout  time.Duration
	ImageName         string
}

Worker represents a container executor. It has a lifetime of a single command execution.

func NewWorker

func NewWorker(image string, tag string, entryPoint string, commandParams ...string) (*Worker, error)

NewWorker will build and returns a new Worker for a single command execution.

func (*Worker) Start

func (w *Worker) Start() (<-chan string, error)

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) Stopped

func (w *Worker) Stopped() <-chan int64

Stopped returns a channel that blocks until this worker's container has stopped. The value emitted is the exit status code of the underlying process.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL