driver

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

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 New

func New(t Type) (ContainerRunner, error)

New creates a new driver based on a type.

func NewDockerDriver

func NewDockerDriver() (ContainerRunner, error)

NewDockerDriver creates a docker driver.

type Streamer

type Streamer interface {
	Stream(ctx context.Context) error
	Close() error
}

Streamer is an interface for streaming in given in/out/err.

type Type

type Type string

Type defines implemented driver types.

const (
	Docker Type = "docker" // Docker driver
)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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