Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSkip is used as a return value when container execution should be // skipped at runtime. It is not returned as an error by any function. ErrSkip = errors.New("Skip") // ErrTerm is used as a return value when the runner should terminate // execution and exit. It is not returned as an error by any function. ErrTerm = errors.New("Terminate") )
var NoContext = context.TODO()
NoContext is the default context you should supply if not using your own context.Context
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Email string `json:"email,omitempty"` Token string `json:"registry_token,omitempty"` }
Auth provides authentication parameters to authenticate to a remote container registry for image download.
type Config ¶
type Config struct { Tracer Tracer Engine Engine // Buffer defines the size of the buffer for the channel to which the // console output is streamed. Buffer uint }
Config defines the configuration for creating the Runner.
type Container ¶
type Container struct { Name string `json:"name"` Alias string `json:"alias"` Image string `json:"image"` Pull bool `json:"pull,omitempty"` AuthConfig Auth `json:"auth_config,omitempty"` Privileged bool `json:"privileged,omitempty"` WorkingDir string `json:"working_dir,omitempty"` Environment map[string]string `json:"environment,omitempty"` Entrypoint []string `json:"entrypoint,omitempty"` Command []string `json:"command,omitempty"` ExtraHosts []string `json:"extra_hosts,omitempty"` Volumes []string `json:"volumes,omitempty"` VolumesFrom []string `json:"volumes_from,omitempty"` Devices []string `json:"devices,omitempty"` Network string `json:"network_mode,omitempty"` DNS []string `json:"dns,omitempty"` DNSSearch []string `json:"dns_search,omitempty"` MemSwapLimit int64 `json:"memswap_limit,omitempty"` MemLimit int64 `json:"mem_limit,omitempty"` CPUQuota int64 `json:"cpu_quota,omitempty"` CPUSet string `json:"cpuset,omitempty"` OomKillDisable bool `json:"oom_kill_disable,omitempty"` }
Container defines the container configuration.
type Engine ¶
type Engine interface { // VolumeCreate(*Volume) (string, error) // VolumeRemove(string) error ContainerStart(*Container) (string, error) ContainerStop(string) error ContainerRemove(string) error ContainerWait(string) (*State, error) ContainerLogs(string) (io.ReadCloser, error) }
Engine defines the container runtime engine.
type Line ¶
type Line struct { Proc string `json:"proc,omitempty"` Time int64 `json:"time,omitempty"` Type int `json:"type,omitempty"` Pos int `json:"pos,omityempty"` Out string `json:"out,omitempty"` }
Line is a line of console output.
type Network ¶
type Network struct { Name string `json:"name,omitempty"` Alias string `json:"alias,omitempty"` Driver string `json:"driver,omitempty"` DriverOpts map[string]string `json:"driver_opts,omitempty"` External bool `json:"external,omitempty"` }
Network defines a container network.
type OomError ¶
type OomError struct {
Name string
}
An OomError reports the process received an OOMKill from the kernel.
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
Pipe returns a buffered pipe that is connected to the console output.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
type Spec ¶
type Spec struct { // Volumes defines a list of all container volumes. Volumes []*Volume `json:"volumes,omitempty"` // Networks defines a list of all container networks. Networks []*Network `json:"networks,omitempty"` // Containers defines a list of all containers in the pipeline. Containers []*Container `json:"containers,omitempty"` // Nodes defines the container execution tree. Nodes *parse.Tree `json:"program,omitempty"` }
Spec defines the pipeline configuration and exeuction.
type State ¶
type State struct { ExitCode int // container exit code OOMKilled bool // container exited due to oom error }
State defines the state of the container.