docker

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 36 Imported by: 9

Documentation

Index

Constants

View Source
const (
	//ContainerSource for events emitted by Docker containers
	ContainerSource = SourceType("container")

	//DaemonSource for events emitted by the Docker daemon
	DaemonSource = SourceType("daemon")

	//ImageSource for events emitted by Docker images
	ImageSource = SourceType("image")

	//NetworkSource for events emitted by Docker networks
	NetworkSource = SourceType("network")

	//PluginSource for events emitted by Docker plugins
	PluginSource = SourceType("plugin")

	//VolumeSource for events emitted by Docker volumes
	VolumeSource = SourceType("volume")

	//ServiceSource for events emitted by Docker services
	ServiceSource = SourceType("service")

	//NodeSource for events emitted by Docker nodes
	NodeSource = SourceType("node")

	//SecretSource for events emitted by Docker secrets
	SecretSource = SourceType("secret")
)
View Source
const (
	//Whale ascii art
	Whale = `` /* 243-byte string literal not displayed */

	//Whale0 ascii art for animations
	Whale0 = `` /* 243-byte string literal not displayed */

	//Whale1 ascii art for animations
	Whale1 = `` /* 243-byte string literal not displayed */

	//Whale2 ascii art for animations
	Whale2 = `` /* 243-byte string literal not displayed */

	//Whale3 ascii art for animations
	Whale3 = `` /* 243-byte string literal not displayed */

	//Whale4 ascii art for animations
	Whale4 = `` /* 243-byte string literal not displayed */

	//Whale5 ascii art for animations
	Whale5 = `` /* 243-byte string literal not displayed */

	//Whale6 ascii art for animations
	Whale6 = `` /* 243-byte string literal not displayed */

	//Whale7 ascii art for animations
	Whale7 = `` /* 243-byte string literal not displayed */

)
View Source
const (
	//DefaultCapacity of a new EventLog.
	DefaultCapacity = 50
)
View Source
const (
	//DefaultConnectionTimeout is the timeout for connecting with the Docker daemon
	DefaultConnectionTimeout = 32 * time.Second
)
View Source
const (
	//DefaultDockerHost is used as a default docker host to connect to
	//if no other value is given.
	DefaultDockerHost = "unix:///var/run/docker.sock"
)
View Source
const (
	// LabelNamespace is the label used to track stack resources
	//Copied from https://github.com/docker/cli/blob/master/cli/compose/convert/compose.go
	LabelNamespace = "com.docker.stack.namespace"
)
View Source
const (

	//ShortLen defines the default size of shortened ID
	ShortLen = 12
)

Variables

View Source
var CommandDescriptions = justDescriptions(ContainerCommands)

CommandDescriptions lists command descriptions in the same order as they are found in ContainerCommands

View Source
var ContainerCommands = []CommandDescription{
	{LOGS, "Fetch logs"},
	{INSPECT, "Inspect container"},
	{KILL, "Kill container"},
	{RM, "Remove container"},
	{RESTART, "Restart"},
	{HISTORY, "Show image history"},
	{STATS, "Stats + Top"},
	{STOP, "Stop"},
}

ContainerCommands is the list of container commands

Functions

func DurationForHumans

func DurationForHumans(duration int64) string

DurationForHumans returns a human-readable approximation of a duration represented as an int64 nanosecond count.

func GetBool

func GetBool(key string) (value bool)

GetBool returns false if the given string looks like you mean false, true otherwise. Func does not belong here.

func ImageID

func ImageID(uglyID string) string

ImageID removes anything that is not part of the ID but is being added by the docker library

func IsContainerRunning

func IsContainerRunning(container *Container) bool

IsContainerRunning returns true if the given container is running

func NewNodeAvailability

func NewNodeAvailability(availability string) swarm.NodeAvailability

NewNodeAvailability builds NodeAvailability from the given string

func ShortImageID

func ShortImageID(uglyID string) string

ShortImageID shortens and beutifies an id

func SortContainers

func SortContainers(containers []*Container, mode SortMode)

SortContainers sorts the given containers slice using the given mode

func SortImages

func SortImages(images []types.ImageSummary, mode SortMode)

SortImages sorts the given image slice using the given mode

func SortNetworks

func SortNetworks(networks []types.NetworkResource, mode SortMode)

SortNetworks sorts the given network slice using the given mode

func SortNodes

func SortNodes(nodes []swarm.Node, mode SortMode)

SortNodes sorts the given nodes slice using the given mode

func SortServices

func SortServices(services []swarm.Service, mode SortMode)

SortServices sorts the given service slice using the given mode

func SortStacks

func SortStacks(stacks []Stack, mode SortMode)

SortStacks sorts the given stack slice using the given mode

func SortTasks

func SortTasks(tasks []swarm.Task, mode SortMode)

SortTasks sorts the given Task slice using the given mode

func TruncateID

func TruncateID(id string) string

TruncateID returns a shorthand version of a string identifier for convenience. A collision with other shorthands is very unlikely, but possible. In case of a collision a lookup with TruncIndex.Get() will fail, and the caller will need to use a longer prefix, or the full-length Id.

Types

type CallbackRegistry

type CallbackRegistry interface {
	Register(actor SourceType, callback EventCallback)
}

CallbackRegistry d

var GlobalRegistry CallbackRegistry

GlobalRegistry is a globally available CallbackRegistry

type Command

type Command int

Command represents a docker command

const (
	//HISTORY Image history command
	HISTORY Command = iota
	//INSPECT Inspect command
	INSPECT
	//KILL kill command
	KILL
	//LOGS logs command
	LOGS
	//RM remove command
	RM
	//RESTART restart command
	RESTART
	//STATS stats command
	STATS
	//STOP stop command
	STOP
)

func CommandFromDescription

func CommandFromDescription(d string) (Command, error)

CommandFromDescription returns the command with the given description, if any

type CommandDescription

type CommandDescription struct {
	Command     Command
	Description string
}

CommandDescription describes docker commands

type Container

type Container struct {
	types.Container
	types.ContainerJSON
}

Container holds a detailed view of a container

type ContainerAPI

type ContainerAPI interface {
	ContainerByID(id string) *Container
	Containers(filter []ContainerFilter, mode SortMode) []*Container
	Inspect(id string) (types.ContainerJSON, error)
	IsContainerRunning(id string) bool
	Kill(id string) error
	Logs(id string, since string, withTimeStamp bool) (io.ReadCloser, error)
	RemoveAllStoppedContainers() (int, error)
	RestartContainer(id string) error
	StopContainer(id string) error
}

ContainerAPI is a subset of the Docker API to manage containers

type ContainerDaemon

type ContainerDaemon interface {
	ContainerAPI
	ImageAPI
	NetworkAPI
	VolumesAPI
	SwarmAPI
	ContainerRuntime
	DiskUsage() (types.DiskUsage, error)
	DockerEnv() Env
	Events() (<-chan events.Message, chan<- struct{}, error)
	EventLog() *EventLog
	Info() (types.Info, error)
	InspectImage(id string) (types.ImageInspect, error)
	Ok() (bool, error)
	Prune() (*PruneReport, error)
	Rm(id string) error
	Refresh(notify func(error))
	RemoveNetwork(id string) error
	Version() (*types.Version, error)
}

ContainerDaemon describes what is expected from the container daemon

type ContainerFilter

type ContainerFilter func(*Container) bool

ContainerFilter defines a function to filter container

var ContainerFilters ContainerFilter

ContainerFilters is a holder of predefined ContainerFilter(s) The intentions is that something like 'ContainerFilters.ByName("name")' can be used to declare a filter.

func (ContainerFilter) Apply

func (cf ContainerFilter) Apply(c []*Container) []*Container

Apply applies this filter to the given slice of containers

func (ContainerFilter) ByID

ByID filters containers by ID

func (ContainerFilter) ByName

func (cf ContainerFilter) ByName(name string) ContainerFilter

ByName filters containers by name

func (ContainerFilter) ByRunningState

func (cf ContainerFilter) ByRunningState(running bool) ContainerFilter

ByRunningState filters containers by its running state

func (ContainerFilter) NotRunning

func (cf ContainerFilter) NotRunning() ContainerFilter

NotRunning filters out container that are running

func (ContainerFilter) Running

func (cf ContainerFilter) Running() ContainerFilter

Running filters out container that are not running

func (ContainerFilter) Unfiltered

func (cf ContainerFilter) Unfiltered() ContainerFilter

Unfiltered does not filter containers

type ContainerRuntime

type ContainerRuntime interface {
	StatsChannel(container *Container) (*StatsChannel, error)
	Top(ctx context.Context, id string) (container.ContainerTopOKBody, error)
}

ContainerRuntime is the subset of the Docker API to query container runtime information

type ContainerStore

type ContainerStore interface {
	Get(id string) *Container
	List() []*Container
	Remove(id string)
	Size() int
}

ContainerStore defines a container storage.

func NewDockerContainerStore

func NewDockerContainerStore(client dockerAPI.ContainerAPIClient) (ContainerStore, error)

NewDockerContainerStore creates a new Docker container store that will use the given Docker daemon client to retrieve container information.

type DockerDaemon

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

DockerDaemon knows how to talk to the Docker daemon

func ConnectToDaemon

func ConnectToDaemon(env Env) (*DockerDaemon, error)

ConnectToDaemon connects to a Docker daemon using the given properties.

func (*DockerDaemon) ContainerByID

func (daemon *DockerDaemon) ContainerByID(cid string) *Container

ContainerByID returns the container with the given ID

func (*DockerDaemon) Containers

func (daemon *DockerDaemon) Containers(filters []ContainerFilter, mode SortMode) []*Container

Containers returns the containers known by the daemon

func (*DockerDaemon) DiskUsage

func (daemon *DockerDaemon) DiskUsage() (dockerTypes.DiskUsage, error)

DiskUsage returns reported Docker disk usage

func (*DockerDaemon) DockerEnv

func (daemon *DockerDaemon) DockerEnv() Env

DockerEnv returns Docker-related environment variables

func (*DockerDaemon) EventLog

func (daemon *DockerDaemon) EventLog() *EventLog

EventLog returns the events log

func (*DockerDaemon) Events

func (daemon *DockerDaemon) Events() (<-chan dockerEvents.Message, chan<- struct{}, error)

Events returns a channel to receive Docker events.

func (*DockerDaemon) History

func (daemon *DockerDaemon) History(id string) ([]image.HistoryResponseItem, error)

History returns image history

func (*DockerDaemon) ImageByID

func (daemon *DockerDaemon) ImageByID(id string) (image.Summary, error)

ImageByID returns the image with the given ID

func (*DockerDaemon) Images

func (daemon *DockerDaemon) Images() ([]image.Summary, error)

Images returns the list of Docker images

func (*DockerDaemon) Info

func (daemon *DockerDaemon) Info() (dockerTypes.Info, error)

Info returns system-wide information about the Docker server.

func (*DockerDaemon) Inspect

func (daemon *DockerDaemon) Inspect(id string) (dockerTypes.ContainerJSON, error)

Inspect the container with the given id

func (*DockerDaemon) InspectImage

func (daemon *DockerDaemon) InspectImage(name string) (dockerTypes.ImageInspect, error)

InspectImage the image with the name

func (*DockerDaemon) IsContainerRunning

func (daemon *DockerDaemon) IsContainerRunning(id string) bool

IsContainerRunning returns true if the container with the given is running

func (*DockerDaemon) Kill

func (daemon *DockerDaemon) Kill(id string) error

Kill the container with the given id

func (*DockerDaemon) Logs

func (daemon *DockerDaemon) Logs(id string, since string, withTimeStamps bool) (io.ReadCloser, error)

Logs shows the logs of the container with the given id

func (*DockerDaemon) NetworkInspect

func (daemon *DockerDaemon) NetworkInspect(id string) (dockerTypes.NetworkResource, error)

NetworkInspect returns network detailed information

func (*DockerDaemon) Networks

func (daemon *DockerDaemon) Networks() ([]dockerTypes.NetworkResource, error)

Networks returns the list of Docker networks

func (*DockerDaemon) Node

func (daemon *DockerDaemon) Node(id string) (*swarm.Node, error)

Node returns the node with the given id

func (*DockerDaemon) NodeChangeAvailability

func (daemon *DockerDaemon) NodeChangeAvailability(nodeID string, availability swarm.NodeAvailability) error

NodeChangeAvailability changes the availability of the given node

func (*DockerDaemon) NodeTasks

func (daemon *DockerDaemon) NodeTasks(nodeID string) ([]swarm.Task, error)

NodeTasks returns the tasks being run by the given node

func (*DockerDaemon) Nodes

func (daemon *DockerDaemon) Nodes() ([]swarm.Node, error)

Nodes returns the nodes that are part of the Swarm

func (*DockerDaemon) Ok

func (daemon *DockerDaemon) Ok() (bool, error)

Ok is true if connecting to the Docker daemon went fine

func (*DockerDaemon) Prune

func (daemon *DockerDaemon) Prune() (*PruneReport, error)

Prune requests the Docker daemon to prune unused containers, images networks and volumes

func (*DockerDaemon) Refresh

func (daemon *DockerDaemon) Refresh(notify func(error))

Refresh the container list asynchronously, using the given notifier to signal operation completion.

func (*DockerDaemon) RemoveAllStoppedContainers

func (daemon *DockerDaemon) RemoveAllStoppedContainers() (int, error)

RemoveAllStoppedContainers removes all stopped containers

func (*DockerDaemon) RemoveDanglingImages

func (daemon *DockerDaemon) RemoveDanglingImages() (int, error)

RemoveDanglingImages removes dangling images

func (*DockerDaemon) RemoveNetwork

func (daemon *DockerDaemon) RemoveNetwork(id string) error

RemoveNetwork removes the network with the given id

func (*DockerDaemon) RemoveUnusedImages

func (daemon *DockerDaemon) RemoveUnusedImages() (int, error)

RemoveUnusedImages removes unused images

func (*DockerDaemon) ResolveNode

func (daemon *DockerDaemon) ResolveNode(id string) (string, error)

ResolveNode will attempt to resolve the given node ID to a name.

func (*DockerDaemon) ResolveService

func (daemon *DockerDaemon) ResolveService(id string) (string, error)

ResolveService will attempt to resolve the given service ID to a name.

func (*DockerDaemon) RestartContainer

func (daemon *DockerDaemon) RestartContainer(id string) error

RestartContainer restarts the container with the given id

func (*DockerDaemon) Rm

func (daemon *DockerDaemon) Rm(id string) error

Rm removes the container with the given id

func (*DockerDaemon) Rmi

func (daemon *DockerDaemon) Rmi(name string, force bool) ([]dockerTypes.ImageDeleteResponseItem, error)

Rmi removes the image with the given name

func (*DockerDaemon) RunImage

func (daemon *DockerDaemon) RunImage(image image.Summary, command string) error

RunImage creates a container based on the given image and runs the given command Kind of like running "docker run $image $command" from the command line.

func (*DockerDaemon) Service

func (daemon *DockerDaemon) Service(id string) (*swarm.Service, error)

Service returns service details of the service with the given id

func (*DockerDaemon) ServiceLogs

func (daemon *DockerDaemon) ServiceLogs(id string, since string, withTimestamps bool) (io.ReadCloser, error)

ServiceLogs returns logs of the service with the given id

func (*DockerDaemon) ServiceRemove

func (daemon *DockerDaemon) ServiceRemove(id string) error

ServiceRemove removes the service with the given in

func (*DockerDaemon) ServiceScale

func (daemon *DockerDaemon) ServiceScale(id string, replicas uint64) error

ServiceScale scales the given service by the given number of replicas

func (*DockerDaemon) ServiceTasks

func (daemon *DockerDaemon) ServiceTasks(services ...string) ([]swarm.Task, error)

ServiceTasks returns the tasks being run that belong to the given list of services

func (*DockerDaemon) ServiceUpdate

func (daemon *DockerDaemon) ServiceUpdate(id string) error

ServiceUpdate forces an update of the given service

func (*DockerDaemon) Services

func (daemon *DockerDaemon) Services() ([]swarm.Service, error)

Services returns the services known by the Swarm

func (*DockerDaemon) StackConfigs

func (daemon *DockerDaemon) StackConfigs(stack string) ([]swarm.Config, error)

StackConfigs returns the configs created for the given stack

func (*DockerDaemon) StackNetworks

func (daemon *DockerDaemon) StackNetworks(stack string) ([]types.NetworkResource, error)

StackNetworks returns the networks created for the given stack

func (*DockerDaemon) StackRemove

func (daemon *DockerDaemon) StackRemove(stack string) error

StackRemove removes the stack with the given in

func (*DockerDaemon) StackSecrets

func (daemon *DockerDaemon) StackSecrets(stack string) ([]swarm.Secret, error)

StackSecrets return the secrets created for the given stack

func (*DockerDaemon) StackServices

func (daemon *DockerDaemon) StackServices(stack string) ([]swarm.Service, error)

StackServices returns the given stack service list

func (*DockerDaemon) StackTasks

func (daemon *DockerDaemon) StackTasks(stack string) ([]swarm.Task, error)

StackTasks returns the given stack task list

func (*DockerDaemon) Stacks

func (daemon *DockerDaemon) Stacks() ([]Stack, error)

Stacks returns the stack list

func (*DockerDaemon) StatsChannel

func (daemon *DockerDaemon) StatsChannel(container *Container) (*StatsChannel, error)

StatsChannel creates a channel with the runtime stats of the given container

func (*DockerDaemon) StopContainer

func (daemon *DockerDaemon) StopContainer(id string) error

StopContainer stops the container with the given id

func (*DockerDaemon) Task

func (daemon *DockerDaemon) Task(id string) (swarm.Task, error)

Task returns the task with the given id

func (*DockerDaemon) Top

Top returns Top information for the given container

func (*DockerDaemon) Version

func (daemon *DockerDaemon) Version() (*dockerTypes.Version, error)

Version returns version information about the Docker Engine

func (*DockerDaemon) VolumeInspect

func (daemon *DockerDaemon) VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error)

VolumeInspect returns the details of the given volume.

func (*DockerDaemon) VolumeList

func (daemon *DockerDaemon) VolumeList(ctx context.Context) ([]*volume.Volume, error)

VolumeList returns the list of volumes.

func (*DockerDaemon) VolumePrune

func (daemon *DockerDaemon) VolumePrune(ctx context.Context) (int, error)

VolumePrune removes unused volumes.

func (*DockerDaemon) VolumeRemove

func (daemon *DockerDaemon) VolumeRemove(ctx context.Context, volumeID string, force bool) error

VolumeRemove removes the given volume.

func (*DockerDaemon) VolumeRemoveAll

func (daemon *DockerDaemon) VolumeRemoveAll(ctx context.Context) (int, error)

VolumeRemoveAll removes all the volumes.

type Env

type Env struct {
	DockerHost       string
	DockerTLSVerify  bool //tls must be verified
	DockerCertPath   string
	DockerAPIVersion string
}

Env holds Docker-related environment variables

func NewEnv

func NewEnv() Env

NewEnv creates a new docker environment struct

type EventCallback

type EventCallback func(ctx context.Context, event events.Message) error

EventCallback defines a callback function for messages

type EventLog

type EventLog struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

EventLog keeps track of docker events. It has a limited capacity and behaves as a Circular Buffer - adding a new event removes the oldest one if the buffer is at its max capacity.

func NewEventLog

func NewEventLog() *EventLog

NewEventLog creates an event log with the default capacity

func (*EventLog) Capacity

func (el *EventLog) Capacity() int

Capacity returns the capacity of the event log.

func (*EventLog) Count

func (el *EventLog) Count() int

Count returns the number of events in the buffer

func (*EventLog) Events

func (el *EventLog) Events() []events.Message

Events returns a copy of the event buffer

func (*EventLog) Init

func (el *EventLog) Init(capacity int)

Init sets the log in a working state. Must be called before doing any other operation

func (*EventLog) Peek

func (el *EventLog) Peek() *events.Message

Peek the latest event added

func (*EventLog) Push

func (el *EventLog) Push(message *events.Message)

Push the given event to this log

type ImageAPI

type ImageAPI interface {
	History(id string) ([]image.HistoryResponseItem, error)
	ImageByID(id string) (types.ImageSummary, error)
	Images() ([]types.ImageSummary, error)
	RemoveDanglingImages() (int, error)
	RemoveUnusedImages() (int, error)
	Rmi(id string, force bool) ([]types.ImageDeleteResponseItem, error)
	RunImage(image types.ImageSummary, command string) error
}

ImageAPI is a subset of the Docker API to manage images

type NetworkAPI

type NetworkAPI interface {
	Networks() ([]types.NetworkResource, error)
	NetworkInspect(id string) (types.NetworkResource, error)
}

NetworkAPI is a subset of the Docker API to manage networks

type PruneReport

type PruneReport struct {
	ContainerReport types.ContainersPruneReport
	ImagesReport    types.ImagesPruneReport
	NetworksReport  types.NetworksPruneReport
	VolumesReport   types.VolumesPruneReport
}

PruneReport represents the result of a prune operation

func (*PruneReport) TotalSpaceReclaimed

func (p *PruneReport) TotalSpaceReclaimed() uint64

TotalSpaceReclaimed reports the total space reclaimed

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, t interface{}, id string) (string, error)
}

Resolver defines the interface for ID to name resolution

type SortMode

type SortMode uint16

SortMode represents allowed modes to sort a container slice

const (
	NoSort SortMode = iota
	SortByContainerID
	SortByImage
	SortByStatus
	SortByName
)

Allowed sort methods

const (
	NoSortImages SortMode = iota
	SortImagesByID
	SortImagesByRepo
	SortImagesBySize
	SortImagesByCreationDate
)

Allowed sort methods

const (
	NoSortNetworks SortMode = iota
	SortNetworksByID
	SortNetworksByName
	SortNetworksByDriver
	SortNetworksByContainerCount
	SortNetworksByServiceCount
	SortNetworksBySubnet
)

Allowed sort methods

const (
	NoSortNode SortMode = iota
	SortByNodeName
	SortByNodeRole
	SortByNodeCPU
	SortByNodeMem
	SortByNodeStatus
)

Allowed sort methods

const (
	NoSortService SortMode = iota
	SortByServiceName
	SortByServiceImage
)

Allowed sort methods

const (
	NoSortTask SortMode = iota
	SortByTaskImage
	SortByTaskService
	SortByTaskState
	SortByTaskDesiredState
)

Allowed sort methods

const (
	NoSortStack SortMode = iota
	SortByStackName
)

Allowed sort methods

type SourceType

type SourceType string

SourceType is a representation of the sources types that might emit Docker events

type Stack

type Stack struct {
	Name         string
	Orchestrator string
	Services     int
	Networks     int
	Configs      int
	Secrets      int
}

Stack contains information about a Docker Swarm stack

type Stats

type Stats struct {
	CID              string
	Command          string
	CPUPercentage    float64
	Memory           float64
	MemoryLimit      float64
	MemoryPercentage float64
	NetworkRx        float64
	NetworkTx        float64
	BlockRead        float64
	BlockWrite       float64
	PidsCurrent      uint64
	Stats            *types.StatsJSON
	ProcessList      *container.ContainerTopOKBody
	Error            error
}

Stats holds runtime stats for a container

type StatsChannel

type StatsChannel struct {
	Container *Container
	// contains filtered or unexported fields
}

StatsChannel manages the stats channel of a container

func (*StatsChannel) Start

func (s *StatsChannel) Start(ctx context.Context) <-chan *Stats

Start starts sending stats to the channel returned

type SwarmAPI

type SwarmAPI interface {
	Node(id string) (*swarm.Node, error)
	NodeChangeAvailability(nodeID string, availability swarm.NodeAvailability) error
	Nodes() ([]swarm.Node, error)
	NodeTasks(nodeID string) ([]swarm.Task, error)
	ResolveNode(id string) (string, error)
	ResolveService(id string) (string, error)
	Service(id string) (*swarm.Service, error)
	ServiceLogs(id string, since string, withTimeStamps bool) (io.ReadCloser, error)
	Services() ([]swarm.Service, error)
	ServiceRemove(id string) error
	ServiceScale(id string, replicas uint64) error
	ServiceTasks(services ...string) ([]swarm.Task, error)
	ServiceUpdate(id string) error
	Stacks() ([]Stack, error)
	StackConfigs(stack string) ([]swarm.Config, error)
	StackNetworks(stack string) ([]types.NetworkResource, error)
	StackRemove(id string) error
	StackSecrets(stack string) ([]swarm.Secret, error)
	StackTasks(stack string) ([]swarm.Task, error)
	Task(id string) (swarm.Task, error)
}

SwarmAPI defines the API for Docker Swarm

type VolumesAPI

type VolumesAPI interface {
	VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error)
	VolumeList(ctx context.Context) ([]*volume.Volume, error)
	VolumePrune(ctx context.Context) (int, error)
	VolumeRemove(ctx context.Context, volumeID string, force bool) error
	VolumeRemoveAll(ctx context.Context) (int, error)
}

VolumesAPI defines the API for Docker volumes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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