docker

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultURL          = "unix:///var/run/docker.sock"
	DefaultVersion      = "1.27"
	StateStarting       = "STARTING"
	StateRunning        = "RUNNING"
	StateError          = "ERROR"
	StateNoMatchingNode = "NO MATCHING NODE"
)

Docker constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Docker

type Docker struct {
	// contains filtered or unexported fields
}

Docker wrapper

func NewClient

func NewClient(url string, version string) *Docker

NewClient instantiates a new Docker wrapper

func (*Docker) ComposeIsAuthorized added in v0.12.0

func (d *Docker) ComposeIsAuthorized(compose *types2.Config) bool

ComposeIsAuthorized checks if the given compose file is authorized

func (*Docker) ComposeParse added in v0.12.0

func (d *Docker) ComposeParse(ctx context.Context, composeFile []byte) (*types2.Config, error)

ComposeParse parses a compose file

func (*Docker) Connect

func (d *Docker) Connect() (err error)

Connect to the docker API

func (*Docker) ContainerCreate

func (d *Docker) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, name string) (*container.ContainerCreateCreatedBody, error)

ContainerCreate creates a container and pulls the image if needed

func (*Docker) ExpectedNumberOfTasks added in v0.12.0

func (d *Docker) ExpectedNumberOfTasks(ctx context.Context, serviceID string) (int, error)

ExpectedNumberOfTasks returns expected number of tasks of a service

func (*Docker) GetClient

func (d *Docker) GetClient() *client.Client

GetClient returns the native docker client

func (*Docker) ImagePull added in v0.9.1

func (d *Docker) ImagePull(ctx context.Context, image string) error

ImagePull pulls a docker image

func (*Docker) NodeInspect added in v0.12.0

func (d *Docker) NodeInspect(ctx context.Context, nodeID string) (swarm.Node, error)

NodeInspect inspects a node

func (*Docker) NodeList added in v0.11.0

func (d *Docker) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)

NodeList list the nodes

func (*Docker) ServiceInspect added in v0.12.0

func (d *Docker) ServiceInspect(ctx context.Context, service string) (swarm.Service, error)

ServiceInspect inspects a service

func (*Docker) ServiceScale added in v0.12.0

func (d *Docker) ServiceScale(ctx context.Context, service string, scale uint64) error

ServiceScale scales a service

func (*Docker) ServiceStatus added in v0.12.0

func (d *Docker) ServiceStatus(ctx context.Context, service string) (*ServiceStatus, error)

ServiceStatus returns service status

func (*Docker) ServicesList added in v0.12.0

func (d *Docker) ServicesList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)

ServiceList list the services

func (*Docker) StackDeploy added in v0.9.1

func (d *Docker) StackDeploy(ctx context.Context, stackName string, composeFile []byte, configFile []byte) (output string, err error)

StackDeploy deploy a stack

func (*Docker) StackList added in v0.9.1

func (d *Docker) StackList(ctx context.Context) (output string, err error)

StackList list the stacks

func (*Docker) StackRemove added in v0.9.1

func (d *Docker) StackRemove(ctx context.Context, stackName string) (output string, err error)

StackRemove remove a stack

func (*Docker) StackServices added in v0.11.0

func (d *Docker) StackServices(ctx context.Context, stackName string, quietOption bool) (output string, err error)

StackServices list the services of a stack

func (*Docker) StackStatus added in v0.12.0

func (d *Docker) StackStatus(ctx context.Context, stackName string) (*StackStatus, error)

StackStatus returns stack status

func (*Docker) TaskList added in v0.10.0

func (d *Docker) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)

TaskList list the tasks

type ServiceStatus added in v0.12.0

type ServiceStatus struct {
	RunningTasks int32
	FailedTasks  int32
	TotalTasks   int32
	Status       string
}

type StackStatus added in v0.12.0

type StackStatus struct {
	RunningServices int32
	FailedServices  int32
	TotalServices   int32
	Status          string
}

Directories

Path Synopsis
docker

Jump to

Keyboard shortcuts

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