libdocker

package
v0.0.0-...-97162c3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsContainerNotFoundError

func IsContainerNotFoundError(err error) bool

IsContainerNotFoundError checks whether the error is container not found error.

func IsImageNotFoundError

func IsImageNotFoundError(err error) bool

IsImageNotFoundError checks whether the error is image not found error. This is exposed to share with dockershim.

Types

type ImageNotFoundError

type ImageNotFoundError struct {
	ID string
}

ImageNotFoundError is the error returned by InspectImage when image not found. Expose this to inject error in dockershim for testing.

func (ImageNotFoundError) Error

func (e ImageNotFoundError) Error() string

type Interface

type Interface interface {
	ListContainers(options dockertypes.ContainerListOptions) ([]dockertypes.Container, error)
	InspectContainer(id string) (*dockertypes.ContainerJSON, error)
	CreateContainer(dockertypes.ContainerCreateConfig) (*dockercontainer.ContainerCreateCreatedBody, error)
	StartContainer(id string) error
	RestartContainer(id string, timeout time.Duration) error
	StopContainer(id string, timeout time.Duration) error
	WaitContainer(name string, timeout time.Duration) error
	UpdateContainerResources(id string, updateConfig dockercontainer.UpdateConfig) error
	RemoveContainer(id string, opts dockertypes.ContainerRemoveOptions) error
	InspectImageByRef(imageRef string) (*dockertypes.ImageInspect, error)
	InspectImageByID(imageID string) (*dockertypes.ImageInspect, error)
	ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error)
	PullImage(image string, auth dockertypes.AuthConfig, opts dockertypes.ImagePullOptions) error
	RemoveImage(image string, opts dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDeleteResponseItem, error)
	Logs(string, dockertypes.ContainerLogsOptions, StreamOptions) error
	Version() (*dockertypes.Version, error)
	Info() (*dockertypes.Info, error)
	AttachExec(string, dockertypes.ExecStartCheck) (*dockertypes.HijackedResponse, error)
	CreateExec(string, dockertypes.ExecConfig) (*dockertypes.IDResponse, error)
	StartExec(string, dockertypes.ExecStartCheck, StreamOptions) error
	InspectExec(id string) (*dockertypes.ContainerExecInspect, error)
	InspectNetwork(id string) (dockertypes.NetworkResource, error)
	CreateNetwork(id string) (dockertypes.NetworkCreateResponse, error)
	ConnectContainerToNetwork(id string, containerid string) error
	DisconnectContainerFromNetwork(id string, containerid string, force bool) error
	RemoveNetwork(id string) error
	ServerVersion() (dockertypes.Version, error)
}

func ConnectToDockerOrDie

func ConnectToDockerOrDie(requestTimeout, imagePullProgressDeadline time.Duration) Interface

type StreamOptions

type StreamOptions struct {
	RawTerminal  bool
	InputStream  io.Reader
	OutputStream io.Writer
	ErrorStream  io.Writer
	ExecStarted  chan struct{}
}

StreamOptions are the options used to configure the stream redirection

Jump to

Keyboard shortcuts

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