Documentation ¶
Index ¶
- Constants
- func NewDockerCli(stdin io.ReadCloser, stdout, stderr io.Writer) *command.DockerCli
- func NodeMatches(constraints []Constraint, n *swarm.Node) bool
- type Constraint
- type Docker
- func (d *Docker) ComposeIsAuthorized(compose *composetypes.Config) bool
- func (d *Docker) ComposeParse(ctx context.Context, composeFile []byte, environment []string) (*composetypes.Config, error)
- func (d *Docker) ConfigExists(name string) (bool, error)
- func (d *Docker) Connect() (err error)
- func (d *Docker) CreateConfig(name string, data []byte) (string, error)
- func (d *Docker) CreateNetwork(name string, overlay bool, attachable bool, subnets []string) (string, error)
- func (d *Docker) CreateSecret(name string, data []byte) (string, error)
- func (d *Docker) ExpectedNumberOfTasks(ctx context.Context, serviceID string) (int32, error)
- func (d *Docker) GetClient() *docker.Client
- func (d *Docker) ListConfigs() ([]swarm.Config, error)
- func (d *Docker) ListNetworks() ([]types.NetworkResource, error)
- func (d *Docker) ListSecrets() ([]swarm.Secret, error)
- func (d *Docker) ListVolumes(filter opts.FilterOpt) ([]*types.Volume, error)
- func (d *Docker) NetworkExists(name string) (bool, error)
- func (d *Docker) NetworkID(name string) (string, error)
- func (d *Docker) NodeInspect(ctx context.Context, nodeID string) (swarm.Node, error)
- func (d *Docker) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)
- func (d *Docker) RemoveNetwork(name string) error
- func (d *Docker) RemoveVolume(name string, force bool, retries int) error
- func (d *Docker) SecretExists(name string) (bool, error)
- func (d *Docker) ServiceInspect(ctx context.Context, service string) (swarm.Service, error)
- func (d *Docker) ServiceScale(ctx context.Context, service string, scale uint64) error
- func (d *Docker) ServiceStatus(ctx context.Context, service *swarm.Service) (*ServiceStatus, error)
- func (d *Docker) ServicesList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
- func (d *Docker) StackDeploy(ctx context.Context, stackName string, composeFile []byte, configFile []byte, ...) (output string, err error)
- func (d *Docker) StackList(ctx context.Context) (output string, err error)
- func (d *Docker) StackRemove(ctx context.Context, stackName string) (output string, err error)
- func (d *Docker) StackServices(ctx context.Context, stackName string, quiet bool) (output string, err error)
- func (d *Docker) StackStatus(ctx context.Context, stackName string) (*StackStatus, error)
- func (d *Docker) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
- func (d *Docker) WaitOnService(ctx context.Context, serviceID string, quiet bool) error
- func (d *Docker) WaitOnStack(ctx context.Context, namespace string, progressWriter io.Writer) []error
- type ServiceStatus
- type StackStatus
- type TasksBySlot
Constants ¶
const ( // NodeLabelPrefix is the constraint key prefix for node labels. NodeLabelPrefix = "node.labels." // EngineLabelPrefix is the constraint key prefix for engine labels. EngineLabelPrefix = "engine.labels." )
const ( DefaultURL = "unix:///var/run/docker.sock" DefaultVersion = "1.32" MinVersion = "1.32" )
Docker constants
const ( StatePreparing = "PREPARING" StateReady = "READY" StateStarting = "STARTING" StateRunning = "RUNNING" StateComplete = "COMPLETE" StateError = "ERROR" StateNoMatchingNode = "NO MATCHING NODE" )
Docker states
Variables ¶
This section is empty.
Functions ¶
func NewDockerCli ¶ added in v0.16.0
func NodeMatches ¶ added in v0.18.0
func NodeMatches(constraints []Constraint, n *swarm.Node) bool
NodeMatches returns true if the node satisfies the given constraints.
Types ¶
type Constraint ¶ added in v0.18.0
type Constraint struct {
// contains filtered or unexported fields
}
Constraint defines a constraint.
func Parse ¶ added in v0.18.0
func Parse(env []string) ([]Constraint, error)
Parse parses list of constraints.
func (*Constraint) Match ¶ added in v0.18.0
func (c *Constraint) Match(whats ...string) bool
Match checks if the Constraint matches the target strings.
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
Docker wrapper
func NewEnvClient ¶ added in v0.18.0
func NewEnvClient() *Docker
NewEnvClient instantiates a new Docker wrapper
func (*Docker) ComposeIsAuthorized ¶ added in v0.12.0
func (d *Docker) ComposeIsAuthorized(compose *composetypes.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, environment []string) (*composetypes.Config, error)
ComposeParse parses a compose file
func (*Docker) ConfigExists ¶ added in v0.16.0
func (*Docker) CreateConfig ¶ added in v0.16.0
func (*Docker) CreateNetwork ¶ added in v0.16.0
func (*Docker) CreateSecret ¶ added in v0.16.0
func (*Docker) ExpectedNumberOfTasks ¶ added in v0.12.0
ExpectedNumberOfTasks returns expected number of tasks of a service
func (*Docker) GetClient ¶
func (d *Docker) GetClient() *docker.Client
GetClient returns the native docker client
func (*Docker) ListConfigs ¶ added in v0.16.0
func (*Docker) ListNetworks ¶ added in v0.16.0
func (d *Docker) ListNetworks() ([]types.NetworkResource, error)
func (*Docker) ListSecrets ¶ added in v0.16.0
func (*Docker) ListVolumes ¶ added in v0.16.0
func (*Docker) NetworkExists ¶ added in v0.16.0
func (*Docker) NodeInspect ¶ added in v0.12.0
NodeInspect inspects a node
func (*Docker) RemoveNetwork ¶ added in v0.16.0
func (*Docker) RemoveVolume ¶ added in v0.16.0
func (*Docker) SecretExists ¶ added in v0.16.0
func (*Docker) ServiceInspect ¶ added in v0.12.0
ServiceInspect inspects a service
func (*Docker) ServiceScale ¶ added in v0.12.0
ServiceScale scales a service
func (*Docker) ServiceStatus ¶ added in v0.12.0
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, environment []string) (output string, err error)
StackDeploy deploys a stack
func (*Docker) StackRemove ¶ added in v0.9.1
StackRemove remove a stack
func (*Docker) StackServices ¶ added in v0.11.0
func (d *Docker) StackServices(ctx context.Context, stackName string, quiet bool) (output string, err error)
StackServices list the services of a stack
func (*Docker) StackStatus ¶ added in v0.12.0
StackStatus returns stack status
func (*Docker) WaitOnService ¶ added in v0.16.0
WaitOnService waits for the service to converge. It outputs a progress bar,
type ServiceStatus ¶ added in v0.12.0
type StackStatus ¶ added in v0.12.0
type TasksBySlot ¶ added in v0.16.0
func (TasksBySlot) Len ¶ added in v0.16.0
func (t TasksBySlot) Len() int
func (TasksBySlot) Less ¶ added in v0.16.0
func (t TasksBySlot) Less(i, j int) bool
func (TasksBySlot) Swap ¶ added in v0.16.0
func (t TasksBySlot) Swap(i, j int)