Documentation
¶
Overview ¶
Package driver hold implementation for action drivers.
Index ¶
- func ContainerIOStream(ctx context.Context, streams launchr.Streams, cio *ContainerInOut, ...) error
- func DockerDisplayJSONMessages(in io.Reader, streams launchr.Streams) error
- func ForwardAllSignals(ctx context.Context, cli ContainerRunner, cid string, sigc <-chan os.Signal)
- func GetRandomName(retry int) string
- func MonitorTtySize(ctx context.Context, d ContainerRunner, cli launchr.Streams, id string, ...) error
- func NotifyAllSignals() chan os.Signal
- func StopCatchSignals(sigc chan os.Signal)
- type ContainerInOut
- type ContainerRunner
- type ContainerRunnerSELinux
- type EscapeError
- type Streamer
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerIOStream ¶
func ContainerIOStream(ctx context.Context, streams launchr.Streams, cio *ContainerInOut, config *ltypes.ContainerCreateOptions) error
ContainerIOStream streams in/out/err to given streams. @todo consider license reference.
func DockerDisplayJSONMessages ¶ added in v0.17.1
DockerDisplayJSONMessages prints docker json output to streams.
func ForwardAllSignals ¶ added in v0.17.1
ForwardAllSignals forwards signals to the container
The channel you pass in must already be setup to receive any signals you want to forward.
func GetRandomName ¶ added in v0.17.1
GetRandomName generates a random human-friendly name.
func MonitorTtySize ¶
func MonitorTtySize(ctx context.Context, d ContainerRunner, cli launchr.Streams, id string, isExec bool) error
MonitorTtySize updates the container tty size when the terminal tty changes size
func NotifyAllSignals ¶ added in v0.17.1
NotifyAllSignals starts watching interrupt signals.
func StopCatchSignals ¶ added in v0.17.1
StopCatchSignals stops catching the signals and closes the specified channel.
Types ¶
type ContainerInOut ¶
type ContainerInOut struct { In io.WriteCloser Out io.Reader }
ContainerInOut stores container driver in/out streams.
func (*ContainerInOut) Close ¶
func (h *ContainerInOut) Close() error
Close closes the hijacked connection and reader.
func (*ContainerInOut) CloseWrite ¶
func (h *ContainerInOut) CloseWrite() error
CloseWrite closes a readWriter for writing.
type ContainerRunner ¶
type ContainerRunner interface { Info(ctx context.Context) (types.SystemInfo, error) ImageEnsure(ctx context.Context, opts types.ImageOptions) (*types.ImageStatusResponse, error) ImageRemove(ctx context.Context, image string, opts types.ImageRemoveOptions) (*types.ImageRemoveResponse, error) CopyToContainer(ctx context.Context, cid string, path string, content io.Reader, opts types.CopyToContainerOptions) error CopyFromContainer(ctx context.Context, cid, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) ContainerStatPath(ctx context.Context, cid string, path string) (types.ContainerPathStat, error) ContainerList(ctx context.Context, opts types.ContainerListOptions) []types.ContainerListResult ContainerCreate(ctx context.Context, opts types.ContainerCreateOptions) (string, error) ContainerStart(ctx context.Context, cid string, opts types.ContainerStartOptions) error ContainerWait(ctx context.Context, cid string, opts types.ContainerWaitOptions) (<-chan types.ContainerWaitResponse, <-chan error) ContainerAttach(ctx context.Context, cid string, opts types.ContainerAttachOptions) (*ContainerInOut, error) ContainerStop(ctx context.Context, cid string) error ContainerKill(ctx context.Context, cid, signal string) error ContainerRemove(ctx context.Context, cid string, opts types.ContainerRemoveOptions) error ContainerResize(ctx context.Context, cid string, opts types.ResizeOptions) error ContainerExecResize(ctx context.Context, cid string, opts types.ResizeOptions) error Close() error }
ContainerRunner defines common interface for container environments.
func NewDockerDriver ¶
func NewDockerDriver() (ContainerRunner, error)
NewDockerDriver creates a docker driver.
type ContainerRunnerSELinux ¶ added in v0.16.0
ContainerRunnerSELinux defines a container runner with SELinux support.
type EscapeError ¶ added in v0.17.1
type EscapeError = term.EscapeError
EscapeError is an error thrown when escape sequence is input.