docker

package
v0.0.0-...-30f8b58 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LibDirs = []string{}
View Source
var WorkingDir = ""

Functions

func CreateContainer

func CreateContainer(conf CreateConfig) (*dc.Container, error)

func CreateExec

func CreateExec(id string, cmd []string, in, out, err bool) (*dc.Exec, error)

func ExecInContainer

func ExecInContainer(container string, args ...string) ([]byte, error)

func GetContainer

func GetContainer(id string) (*dc.Container, error)

func ImageExists

func ImageExists(image string) bool

func InspectContainer

func InspectContainer(id string) (*dc.Container, error)

func InstallImage

func InstallImage(image string) error

func KillContainer

func KillContainer(id, sig string) error

func ListContainers

func ListContainers(labels ...string) ([]*dc.Container, error)

func ListImages

func ListImages() ([]dc.APIImages, error)

func RemoveContainer

func RemoveContainer(id string) error

func ResizeContainerTTY

func ResizeContainerTTY(id string, height, width int) error

func ResizeExecTTY

func ResizeExecTTY(id string, height, width int) error

func RunExec

func RunExec(exec *dc.Exec, in io.Reader, out io.Writer, err io.Writer) (*dc.ExecInspect, error)

func StartContainer

func StartContainer(id string) error

func WaitContainer

func WaitContainer(id string) (int, error)

Types

type ClientInterface

type ClientInterface interface {
	ListImages(opts dc.ListImagesOptions) ([]dc.APIImages, error)
	PullImage(opts dc.PullImageOptions, auth dc.AuthConfiguration) error
	CreateContainer(opts dc.CreateContainerOptions) (*dc.Container, error)
	StartContainer(id string, hostConfig *dc.HostConfig) error
	KillContainer(opts dc.KillContainerOptions) error
	ResizeContainerTTY(id string, height, width int) error
	StopContainer(id string, timeout uint) error
	RemoveContainer(opts dc.RemoveContainerOptions) error
	WaitContainer(id string) (int, error)
	InspectContainer(id string) (*dc.Container, error)
	ListContainers(opts dc.ListContainersOptions) ([]dc.APIContainers, error)
	CreateExec(opts dc.CreateExecOptions) (*dc.Exec, error)
	ResizeExecTTY(id string, height, width int) error
	StartExec(id string, opts dc.StartExecOptions) error
	InspectExec(id string) (*dc.ExecInspect, error)
}
var Client ClientInterface

type CreateConfig

type CreateConfig struct {
	Category string
	UID      string
	Name     string
	Cmd      []string
	Image    string
}

type DockerDefault

type DockerDefault interface {
	CreateContainer(conf CreateConfig) (*dc.Container, error)
	StartContainer(id string) error
	KillContainer(id, sig string) error
	ResizeContainerTTY(id string, height, width int) error
	WaitContainer(id string) (int, error)
	RemoveContainer(id string) error
	InspectContainer(id string) (*dc.Container, error)
	GetContainer(id string) (*dc.Container, error)
	ListContainers(labels ...string) ([]*dc.Container, error)
	InstallImage(image string) error
	ListImages() ([]dc.APIImages, error)
	ImageExists(name string) bool
	ExecInContainer(container string, args ...string) ([]byte, error)
	CreateExec(id string, cmd []string, in, out, err bool) (*dc.Exec, error)
	ResizeExecTTY(id string, height, width int) error
	RunExec(exec *dc.Exec, in io.Reader, out io.Writer, err io.Writer) (*dc.ExecInspect, error)
}
var Default DockerDefault

type DockerUtil

type DockerUtil struct {
}

func (DockerUtil) CreateContainer

func (d DockerUtil) CreateContainer(conf CreateConfig) (*dc.Container, error)

func (DockerUtil) CreateExec

func (d DockerUtil) CreateExec(id string, cmd []string, in, out, err bool) (*dc.Exec, error)

create a new exec object in docker this new exec object can then be ran.

func (DockerUtil) ExecInContainer

func (d DockerUtil) ExecInContainer(container string, args ...string) ([]byte, error)

Exec

func (DockerUtil) GetContainer

func (d DockerUtil) GetContainer(id string) (*dc.Container, error)

GetContainer

func (DockerUtil) ImageExists

func (d DockerUtil) ImageExists(name string) bool

func (DockerUtil) InspectContainer

func (d DockerUtil) InspectContainer(id string) (*dc.Container, error)

InspectContainer

func (DockerUtil) InstallImage

func (d DockerUtil) InstallImage(image string) error

func (DockerUtil) KillContainer

func (d DockerUtil) KillContainer(id, sig string) error

func (DockerUtil) ListContainers

func (d DockerUtil) ListContainers(labels ...string) ([]*dc.Container, error)

ListContainers

func (DockerUtil) ListImages

func (d DockerUtil) ListImages() ([]dc.APIImages, error)

func (DockerUtil) RemoveContainer

func (d DockerUtil) RemoveContainer(id string) error

RemoveContainer

func (DockerUtil) ResizeContainerTTY

func (d DockerUtil) ResizeContainerTTY(id string, height, width int) error

func (DockerUtil) ResizeExecTTY

func (d DockerUtil) ResizeExecTTY(id string, height, width int) error

resize the exec.

func (DockerUtil) RunExec

func (d DockerUtil) RunExec(exec *dc.Exec, in io.Reader, out io.Writer, err io.Writer) (*dc.ExecInspect, error)

Start the exec. This will hang until the exec exits.

func (DockerUtil) StartContainer

func (d DockerUtil) StartContainer(id string) error

Start

func (DockerUtil) WaitContainer

func (d DockerUtil) WaitContainer(id string) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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