Documentation
¶
Overview ¶
Package driver hold implementation for action drivers.
Index ¶
- func ContainerIOStream(ctx context.Context, appCli cli.Streams, cio *ContainerInOut, ...) error
- func MonitorTtySize(ctx context.Context, d ContainerRunner, cli cli.Streams, id string, ...) error
- type ContainerAttachOptions
- type ContainerCreateOptions
- type ContainerInOut
- type ContainerListOptions
- type ContainerListResult
- type ContainerRemoveOptions
- type ContainerRunner
- type ContainerStartOptions
- type ContainerStopOptions
- type ContainerWaitOptions
- type ContainerWaitResponse
- type ImageOptions
- type ImageStatus
- type ImageStatusResponse
- type ResizeOptions
- type Streamer
- type Type
- type WaitCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerIOStream ¶
func ContainerIOStream(ctx context.Context, appCli cli.Streams, cio *ContainerInOut, config *ContainerCreateOptions) error
ContainerIOStream streams in/out/err to given streams.
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 ContainerAttachOptions ¶
type ContainerAttachOptions struct {
AttachStdin bool
AttachStdout bool
AttachStderr bool
Tty bool
}
ContainerAttachOptions stores options for attaching to a running container.
type ContainerCreateOptions ¶
type ContainerCreateOptions struct {
ContainerName string
Image string
Cmd []string
WorkingDir string
Mounts map[string]string
ExtraHosts []string
AutoRemove bool
OpenStdin bool
StdinOnce bool
AttachStdin bool
AttachStdout bool
AttachStderr bool
Tty bool
Env []string
}
ContainerCreateOptions stores options for creating a new container.
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 ContainerListOptions ¶
type ContainerListOptions struct {
SearchName string
}
ContainerListOptions stores options to request container list.
type ContainerListResult ¶
ContainerListResult defines container list result.
type ContainerRemoveOptions ¶
type ContainerRemoveOptions struct {
}
ContainerRemoveOptions stores options to remove a container.
type ContainerRunner ¶
type ContainerRunner interface {
ImageEnsure(ctx context.Context, opts ImageOptions) (*ImageStatusResponse, error)
ContainerList(ctx context.Context, opts ContainerListOptions) []ContainerListResult
ContainerCreate(ctx context.Context, opts ContainerCreateOptions) (string, error)
ContainerStart(ctx context.Context, cid string, opts ContainerStartOptions) error
ContainerWait(ctx context.Context, cid string, opts ContainerWaitOptions) (<-chan ContainerWaitResponse, <-chan error)
ContainerAttach(ctx context.Context, cid string, opts 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 ContainerRemoveOptions) error
ContainerResize(ctx context.Context, cid string, opts ResizeOptions) error
ContainerExecResize(ctx context.Context, cid string, opts ResizeOptions) error
Close() error
}
ContainerRunner defines common interface for container environments.
func NewDockerDriver ¶
func NewDockerDriver() (ContainerRunner, error)
NewDockerDriver creates a docker driver.
type ContainerStartOptions ¶
type ContainerStartOptions struct {
}
ContainerStartOptions stores options for starting a container.
type ContainerStopOptions ¶
ContainerStopOptions stores options to stop a container.
type ContainerWaitOptions ¶
type ContainerWaitOptions struct {
Condition WaitCondition
}
ContainerWaitOptions stores options for waiting while container works.
type ContainerWaitResponse ¶
ContainerWaitResponse stores response given by wait result.
type ImageOptions ¶
type ImageOptions struct {
Name string
Build *cli.BuildDefinition
}
ImageOptions stores options for creating/pulling an image.
type ImageStatus ¶
type ImageStatus int64
ImageStatus defines image status on local machine.
const ( ImageExists ImageStatus = iota // ImageExists - image exists locally. ImageUnexpectedError // ImageUnexpectedError - image can't be pulled or retrieved. ImagePull // ImagePull - image is being pulled from the registry. ImageBuild // ImageBuild - image is being built. )
type ImageStatusResponse ¶
type ImageStatusResponse struct {
Status ImageStatus
Progress io.ReadCloser
}
ImageStatusResponse stores response when getting the image.
type ResizeOptions ¶
ResizeOptions is a struct for terminal resizing.
type Type ¶
type Type string
Type defines implemented driver types.
const (
Docker Type = "docker" // Docker driver
)
type WaitCondition ¶
type WaitCondition string
WaitCondition is a type for available wait conditions.
const ( WaitConditionNotRunning WaitCondition = "not-running" // WaitConditionNotRunning when container exits when running. WaitConditionNextExit WaitCondition = "next-exit" // WaitConditionNextExit when container exits after next start. WaitConditionRemoved WaitCondition = "removed" // WaitConditionRemoved when container is removed. )