docker

package
v0.0.0-...-3567eeb Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrNotFound

func IsErrNotFound(err error) bool

Types

type Container

type Container = containertypes.Summary

type ContainerJSON

type ContainerJSON = containertypes.InspectResponse

type ContainerListOptions

type ContainerListOptions = containertypes.ListOptions

type ContainerLogsOptions

type ContainerLogsOptions = containertypes.LogsOptions

type ContainerRemoveOptions

type ContainerRemoveOptions = containertypes.RemoveOptions

type ContainersPruneReport

type ContainersPruneReport = containertypes.PruneReport

type Docker

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

func NewDocker

func NewDocker() *Docker

func (*Docker) ConfigCreate

func (d *Docker) ConfigCreate(ctx context.Context, spec *swarm.ConfigSpec) (id string, err error)

ConfigCreate create a config.

func (*Docker) ConfigInspect

func (d *Docker) ConfigInspect(ctx context.Context, id string) (cfg swarm.Config, raw []byte, err error)

ConfigInspect returns config information with raw data.

func (*Docker) ConfigList

func (d *Docker) ConfigList(ctx context.Context, name string, pageIndex, pageSize int) (configs []swarm.Config, total int, err error)

ConfigList return all configs.

func (*Docker) ConfigRemove

func (d *Docker) ConfigRemove(ctx context.Context, id string) error

ConfigRemove remove a config.

func (*Docker) ConfigUpdate

func (d *Docker) ConfigUpdate(ctx context.Context, id string, version uint64, spec *swarm.ConfigSpec) error

ConfigUpdate update a config.

func (*Docker) ContainerExecAttach

func (d *Docker) ContainerExecAttach(ctx context.Context, node, id string) (resp types.HijackedResponse, err error)

ContainerExecAttach attaches a connection to an exec process in the server.

func (*Docker) ContainerExecCreate

func (d *Docker) ContainerExecCreate(ctx context.Context, node, id string, cmd string) (resp IDResponse, err error)

ContainerExecCreate creates an exec instance.

func (*Docker) ContainerExecStart

func (d *Docker) ContainerExecStart(ctx context.Context, node, id string) (err error)

ContainerExecStart starts an exec instance.

func (*Docker) ContainerInspect

func (d *Docker) ContainerInspect(ctx context.Context, node, id string) (container ContainerJSON, raw []byte, err error)

ContainerInspect return container raw information.

func (*Docker) ContainerList

func (d *Docker) ContainerList(ctx context.Context, node, name, status string, pageIndex, pageSize int) (containers []Container, total int, err error)

ContainerList return containers on the host.

func (*Docker) ContainerLogs

func (d *Docker) ContainerLogs(ctx context.Context, node, id string, lines int, timestamps bool) (stdout, stderr *bytes.Buffer, err error)

ContainerLogs returns the logs generated by a container.

func (*Docker) ContainerPrune

func (d *Docker) ContainerPrune(ctx context.Context, node string) (report ContainersPruneReport, err error)

ContainerPrune remove all unused containers.

func (*Docker) ContainerRemove

func (d *Docker) ContainerRemove(ctx context.Context, node, id string) (err error)

ContainerRemove remove a container.

func (*Docker) ImageHistory

func (d *Docker) ImageHistory(ctx context.Context, node, id string) (histories []HistoryResponseItem, err error)

ImageHistory returns the changes in an image in history format.

func (*Docker) ImageInspect

func (d *Docker) ImageInspect(ctx context.Context, node, id string) (image ImageInspect, raw []byte, err error)

ImageInspect returns image information.

func (*Docker) ImageList

func (d *Docker) ImageList(ctx context.Context, node, name string, pageIndex, pageSize int) (images []ImageSummary, total int, err error)

ImageList return images on the host.

func (*Docker) ImagePrune

func (d *Docker) ImagePrune(ctx context.Context, node string) (report ImagesPruneReport, err error)

ImagePrune remove all unused images.

func (*Docker) ImageRemove

func (d *Docker) ImageRemove(ctx context.Context, node, id string) error

ImageRemove remove a image.

func (*Docker) NetworkCount

func (d *Docker) NetworkCount(ctx context.Context) (count int, err error)

NetworkCount return number of networks.

func (*Docker) NetworkCreate

func (d *Docker) NetworkCreate(ctx context.Context, name string, options *NetworkCreate) error

NetworkCreate create a network.

func (*Docker) NetworkDisconnect

func (d *Docker) NetworkDisconnect(ctx context.Context, network, container string) error

NetworkDisconnect Disconnect a container from a network.

func (*Docker) NetworkInspect

func (d *Docker) NetworkInspect(ctx context.Context, name string) (network NetworkResource, raw []byte, err error)

NetworkInspect return network information.

func (*Docker) NetworkList

func (d *Docker) NetworkList(ctx context.Context) (networks []NetworkResource, err error)

NetworkList return all networks.

func (*Docker) NetworkNames

func (d *Docker) NetworkNames(ctx context.Context, ids ...string) (names map[string]string, err error)

NetworkNames return network names by id list.

func (*Docker) NetworkRemove

func (d *Docker) NetworkRemove(ctx context.Context, name string) error

NetworkRemove remove a network.

func (*Docker) NodeCount

func (d *Docker) NodeCount(ctx context.Context) (count int, err error)

NodeCount return number of swarm nodes.

func (*Docker) NodeInspect

func (d *Docker) NodeInspect(ctx context.Context, id string) (node swarm.Node, raw []byte, err error)

NodeInspect return node information.

func (*Docker) NodeList

func (d *Docker) NodeList(ctx context.Context) (nodes []swarm.Node, err error)

NodeList return all swarm nodes.

func (*Docker) NodeMap

func (d *Docker) NodeMap() (map[string]*Node, error)

func (*Docker) NodeRemove

func (d *Docker) NodeRemove(ctx context.Context, id string) error

NodeRemove remove a swarm node from cluster.

func (*Docker) NodeUpdate

func (d *Docker) NodeUpdate(ctx context.Context, id string, version uint64, spec *swarm.NodeSpec) error

NodeUpdate update a node.

func (*Docker) SecretCreate

func (d *Docker) SecretCreate(ctx context.Context, spec *swarm.SecretSpec) (id string, err error)

SecretCreate create a secret.

func (*Docker) SecretInspect

func (d *Docker) SecretInspect(ctx context.Context, id string) (secret swarm.Secret, raw []byte, err error)

SecretInspect returns secret information with raw data.

func (*Docker) SecretList

func (d *Docker) SecretList(ctx context.Context, name string, pageIndex, pageSize int) (secrets []swarm.Secret, total int, err error)

SecretList return all secrets.

func (*Docker) SecretRemove

func (d *Docker) SecretRemove(ctx context.Context, id string) error

SecretRemove remove a secret.

func (*Docker) SecretUpdate

func (d *Docker) SecretUpdate(ctx context.Context, id string, version uint64, spec *swarm.SecretSpec) error

SecretUpdate update a config.

func (*Docker) ServiceCount

func (d *Docker) ServiceCount(ctx context.Context) (count int, err error)

ServiceCount return number of services.

func (*Docker) ServiceCreate

func (d *Docker) ServiceCreate(ctx context.Context, spec *swarm.ServiceSpec, registryAuth string) error

ServiceCreate create a service.

func (*Docker) ServiceInspect

func (d *Docker) ServiceInspect(ctx context.Context, name string, status bool) (service swarm.Service, raw []byte, err error)

ServiceInspect return service raw information.

func (*Docker) ServiceList

func (d *Docker) ServiceList(ctx context.Context, name, mode string, pageIndex, pageSize int) (services []swarm.Service, totalCount int, err error)

ServiceList return service list.

func (*Docker) ServiceLogs

func (d *Docker) ServiceLogs(ctx context.Context, name string, lines int, timestamps bool) (stdout, stderr *bytes.Buffer, err error)

ServiceLogs returns the logs generated by a service.

func (*Docker) ServiceRemove

func (d *Docker) ServiceRemove(ctx context.Context, name string) error

ServiceRemove remove a service.

func (*Docker) ServiceRestart

func (d *Docker) ServiceRestart(ctx context.Context, name string) error

ServiceRestart force to refresh a service.

func (*Docker) ServiceRollback

func (d *Docker) ServiceRollback(ctx context.Context, name string) error

ServiceRollback rollbacks a service.

func (*Docker) ServiceScale

func (d *Docker) ServiceScale(ctx context.Context, name string, count, version uint64) error

ServiceScale adjust replicas of a service.

func (*Docker) ServiceSearch

func (d *Docker) ServiceSearch(ctx context.Context, args filters.Args) (services []swarm.Service, err error)

ServiceSearch search services with args.

func (*Docker) ServiceUpdate

func (d *Docker) ServiceUpdate(ctx context.Context, spec *swarm.ServiceSpec, version uint64) error

ServiceUpdate update a service.

func (*Docker) StackCount

func (d *Docker) StackCount(ctx context.Context) (count int, err error)

StackCount return number of stacks.

func (*Docker) StackDeploy

func (d *Docker) StackDeploy(ctx context.Context, cfg *composetypes.Config, authes map[string]string) error

StackDeploy deploy a stack.

func (*Docker) StackList

func (d *Docker) StackList(ctx context.Context) (stacks map[string][]string, err error)

StackList return all stacks.

func (*Docker) StackRemove

func (d *Docker) StackRemove(ctx context.Context, name string) error

StackRemove remove a stack.

func (*Docker) TaskInspect

func (d *Docker) TaskInspect(ctx context.Context, id string) (task swarm.Task, raw []byte, err error)

TaskInspect return detail information of a task.

func (*Docker) TaskList

func (d *Docker) TaskList(ctx context.Context, node, service, state string, pageIndex, pageSize int) (tasks []swarm.Task, total int, err error)

TaskList return all running tasks of a service or a node.

func (*Docker) TaskLogs

func (d *Docker) TaskLogs(ctx context.Context, id string, lines int, timestamps bool) (stdout, stderr *bytes.Buffer, err error)

TaskLogs returns the logs generated by a task in an io.ReadCloser.

func (*Docker) VolumeCreate

func (d *Docker) VolumeCreate(ctx context.Context, node string, options *VolumeCreateBody) (err error)

VolumeCreate create a volume.

func (*Docker) VolumeInspect

func (d *Docker) VolumeInspect(ctx context.Context, node, name string) (vol Volume, raw []byte, err error)

VolumeInspect return volume raw information.

func (*Docker) VolumeList

func (d *Docker) VolumeList(ctx context.Context, node, name string, pageIndex, pageSize int) (volumes []*Volume, total int, err error)

VolumeList return volumes on host.

func (*Docker) VolumePrune

func (d *Docker) VolumePrune(ctx context.Context, node string) (report VolumesPruneReport, err error)

VolumePrune remove all unused volumes.

func (*Docker) VolumeRemove

func (d *Docker) VolumeRemove(ctx context.Context, node, name string) (err error)

VolumeRemove remove a volume.

type ExecConfig

type ExecConfig = containertypes.ExecOptions

type ExecStartCheck

type ExecStartCheck = containertypes.ExecStartOptions

type HistoryResponseItem

type HistoryResponseItem = image.HistoryResponseItem

type IDResponse

type ImageInspect

type ImageInspect = image.InspectResponse

type ImageListOptions

type ImageListOptions = image.ListOptions

type ImageRemoveOptions

type ImageRemoveOptions = image.RemoveOptions

type ImageSummary

type ImageSummary = image.Summary

type ImagesPruneReport

type ImagesPruneReport = image.PruneReport

type NetworkCreate

type NetworkCreate = networktypes.CreateRequest

type NetworkInspectOptions

type NetworkInspectOptions = networktypes.InspectOptions

type NetworkListOptions

type NetworkListOptions = networktypes.ListOptions

type NetworkResource

type NetworkResource = networktypes.Inspect

type Node

type Node struct {
	ID    string          `json:"id,omitempty"`
	Name  string          `json:"name,omitempty"`
	State swarm.NodeState `json:"-"`
	Agent string          `json:"-"`
}

type ServiceCreateOptions

type ServiceCreateOptions = swarm.ServiceCreateOptions

type ServiceCreateResponse

type ServiceCreateResponse = swarm.ServiceCreateResponse

type ServiceListOptions

type ServiceListOptions = swarm.ServiceListOptions

type ServiceUpdateOptions

type ServiceUpdateOptions = swarm.ServiceUpdateOptions

type ServiceUpdateResponse

type ServiceUpdateResponse = swarm.ServiceUpdateResponse

type Volume

type Volume = volume.Volume

type VolumeCreateBody

type VolumeCreateBody = volume.CreateOptions

type VolumeListOKBody

type VolumeListOKBody = volume.ListResponse

type VolumeListOptions

type VolumeListOptions = volume.ListOptions

type VolumesPruneReport

type VolumesPruneReport = volume.PruneReport

Source Files

  • config.go
  • container.go
  • docker.go
  • image.go
  • network.go
  • node.go
  • secret.go
  • service.go
  • stack.go
  • task.go
  • volume.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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