Documentation
¶
Overview ¶
Package driver hold implementation for action drivers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerIOStream ¶
func ContainerIOStream(ctx context.Context, streams cli.Streams, cio *ContainerInOut, config *types2.ContainerCreateOptions) error
ContainerIOStream streams in/out/err to given streams. @todo consider license reference.
func MonitorTtySize ¶
func MonitorTtySize(ctx context.Context, d ContainerRunner, cli cli.Streams, id string, isExec bool) error
MonitorTtySize updates the container tty size when the terminal tty changes size
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 {
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.
Click to show internal directories.
Click to hide internal directories.