docker

package
v0.0.0-...-bbea77e Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package docker contains code for integrating with Docker.

Index

Constants

View Source
const (
	// DockerSwarmServiceIDLabel key.
	DockerSwarmServiceIDLabel = "com.docker.swarm.service.id"

	// HypochronosStateLabelPattern key pattern with placeholder for the service
	// name.
	HypochronosStateLabelPattern = "de.mtneug.hypochronos.state.%s"
)

Variables

View Source
var (
	// StdClient is the default Docker client instance.
	StdClient *docker.Client

	// Err is the error that was returned when creating the Docker client.
	Err error
)

Functions

func ContainerListService

func ContainerListService(ctx context.Context, serviceID string) ([]types.Container, error)

ContainerListService lists all container of a specific service.

func ContainerWriteTTL

func ContainerWriteTTL(ctx context.Context, containerID string, until time.Time) error

ContainerWriteTTL writes a TTL file to given container.

func EventsContainerCreate

func EventsContainerCreate(ctx context.Context) (<-chan events.Message, <-chan error)

EventsContainerCreate creates a Docker events and error channel that is filtered for container creation events.

func NodeDeleteServiceStateLabel

func NodeDeleteServiceStateLabel(ctx context.Context, node *swarm.Node, srvName string) error

NodeDeleteServiceStateLabel removes the status label on given node for given service.

func NodeGetServiceStateLabel

func NodeGetServiceStateLabel(node *swarm.Node, srvName string) string

NodeGetServiceStateLabel extracts the value of the status label on given node for given service.

func NodeSetServiceStateLabel

func NodeSetServiceStateLabel(ctx context.Context, node *swarm.Node, srvName string, state string) error

NodeSetServiceStateLabel writes a value to the status label on given node for given service.

func ParallelForEachContainer

func ParallelForEachContainer(ctx context.Context, containers []types.Container,
	op func(ctx context.Context, container types.Container) error) (err <-chan error)

ParallelForEachContainer executes op parallel for each given container.

func PrintInfo

func PrintInfo(ctx context.Context, w io.Writer) (err error)

PrintInfo writes informations about Docker relevant to hypochronos to the given Writer.

// Print to Stdout
docker.PrintInfo(context.Background(), os.Stdout)

Types

This section is empty.

Jump to

Keyboard shortcuts

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