Versions in this module Expand all Collapse all v1 v1.13.0 Aug 3, 2026 Changes in this version + var ContextArchiveExts = []string + func AddNodeLabel(ctx context.Context, nodeID string, key string, value string) error + func BuildRawLogArgs(ctxName, serviceID string, extra ...string) []string + func CheckContextExportExists(contextName string) bool + func ClientFor(ctxName string) (*client.Client, error) + func CreateConfig(ctx context.Context, name string, data []byte, labels map[string]string) (swarm.Config, error) + func CreateConfigVersion(ctx context.Context, baseConfig swarm.Config, newData []byte) (swarm.Config, error) + func CreateConfigWith(ctx context.Context, cli *client.Client, name string, data []byte, ...) (swarm.Config, error) + func CreateContext(name, dockerHost string) error + func CreateContextWithCertFiles(name, description, dockerHost, caFile, certFile, keyFile string, ...) error + func CreateContextWithTLS(name, dockerHost, tlsPath string, skipTLSVerify bool) error + func CreateNetwork(ctx context.Context, name string, opts network.CreateOptions) (string, []string, error) + func CreateNetworkWith(ctx context.Context, cli *client.Client, name string, ...) (string, []string, error) + func CreateSecret(ctx context.Context, name string, data []byte, labels map[string]string) (swarm.Secret, error) + func CreateSecretVersion(ctx context.Context, baseSecret swarm.Secret, newData []byte) (swarm.Secret, error) + func CreateService(ctx context.Context, spec swarm.ServiceSpec) (string, error) + func DeleteConfig(ctx context.Context, nameOrID string) error + func DeleteConfigWith(ctx context.Context, cli *client.Client, nameOrID string) error + func DeleteContext(contextName string) error + func DeleteSecret(ctx context.Context, nameOrID string) error + func DemoteNode(ctx context.Context, nodeID string) error + func DeployStack(stackName string, yamlContent string) error + func DeployStackInContext(ctx context.Context, ctxName, stackName, yamlContent string, ...) error + func DeployStackResolved(ctx context.Context, stackName string, yamlContent string, ...) error + func ExportContext(contextName string) (string, error) + func ExportContextWithForce(contextName string) (string, error) + func GetClient() (*client.Client, error) + func GetContainerCount() (int, error) + func GetContextFromEnv() (string, error) + func GetCurrentContext() (string, error) + func GetDockerContext() (string, error) + func GetDockerVersion() (string, error) + func GetLocalNodeID(ctx context.Context) (string, error) + func GetNodeIDToHostnameMap() (map[string]string, error) + func GetNodeIDToHostnameMapFromDocker(ctx context.Context) (map[string]string, error) + func GetServiceCount() (int, error) + func GetServiceLogs(ctx context.Context, serviceID string) (string, error) + func GetServiceTaskDiagnostics(ctx context.Context, serviceID string) (string, error) + func GetStackInspection(stackName string) (string, error) + func GetStackNetworks(ctx context.Context, stackName string) ([]string, error) + func GetSwarmCPUCapacity() (float64, error) + func GetSwarmCPUUsage() (string, error) + func GetSwarmMemCapacity() (int64, error) + func GetSwarmMemUsage() (string, error) + func GetSwarmResourceUsage() (cpuPct string, memPct string, err error) + func ImportContext(filePath string) (string, error) + func Inspect(ctx context.Context, t InspectType, id string) (string, error) + func InspectContext(contextName string) (string, error) + func InspectNetwork(ctx context.Context, networkID string) (network.Inspect, error) + func InspectVolume(ctx context.Context, name string) (volume.Volume, error) + func InvalidateSnapshot() + func IsSwarmLockedErr(err error) bool + func ListConfigs(ctx context.Context) ([]swarm.Config, error) + func ListConfigsWith(ctx context.Context, cli *client.Client) ([]swarm.Config, error) + func ListNetworks(ctx context.Context) ([]network.Summary, error) + func ListNetworksWith(ctx context.Context, cli *client.Client) ([]network.Summary, error) + func ListSecrets(ctx context.Context) ([]swarm.Secret, error) + func ListSecretsWith(ctx context.Context, cli *client.Client) ([]swarm.Secret, error) + func ListServicesUsingConfigID(ctx context.Context, configID string) ([]swarm.Service, error) + func ListServicesUsingConfigName(ctx context.Context, name string) ([]swarm.Service, error) + func ListServicesUsingNetwork(ctx context.Context, networkID, networkName string) ([]string, error) + func ListServicesUsingSecretID(ctx context.Context, secretID string) ([]swarm.Service, error) + func ListServicesUsingSecretName(ctx context.Context, name string) ([]swarm.Service, error) + func PromoteNode(ctx context.Context, nodeID string) error + func PruneNetworks(ctx context.Context) (network.PruneReport, error) + func ReconstructStackCompose(stackName string) (string, error) + func RefreshHostnameCache() error + func RefreshSnapshotAsync() + func RemoveNetwork(ctx context.Context, networkID string) error + func RemoveNetworkWith(ctx context.Context, cli *client.Client, networkID string) error + func RemoveNode(ctx context.Context, nodeID string, force bool) error + func RemoveNodeLabel(ctx context.Context, nodeID string, key string) error + func RemoveService(ctx context.Context, serviceName string) error + func RemoveStack(ctx context.Context, stackName string) error + func RemoveStackCLI(ctx context.Context, stackName string) error + func RemoveStackCLIInContext(ctx context.Context, ctxName, stackName string) error + func RemoveStackNetworks(ctx context.Context, stackName string) error + func RemoveVolume(ctx context.Context, name string, force bool) error + func RemoveVolumeWith(ctx context.Context, cli *client.Client, name string, force bool) error + func ResetClient() + func RestartService(ctx context.Context, serviceName string) error + func RestartServiceAndWait(ctx context.Context, serviceName string) error + func RestartServiceWithProgress(ctx context.Context, serviceName string, progressCh chan<- ProgressUpdate) error + func RollbackService(ctx context.Context, serviceName string) error + func RotateConfigInServices(ctx context.Context, oldCfg *swarm.Config, newCfg swarm.Config) error + func RotateSecretInServices(ctx context.Context, oldSec *swarm.Secret, newSec swarm.Secret) error + func ScaleService(ctx context.Context, serviceID string, replicas uint64) error + func ScaleServiceByName(ctx context.Context, serviceName string, replicas uint64) error + func ServicesUsingConfigs(ctx context.Context) (map[string][]swarm.Service, error) + func ServicesUsingConfigsWith(ctx context.Context, cli *client.Client) (map[string][]swarm.Service, error) + func ServicesUsingSecrets(ctx context.Context) (map[string][]swarm.Service, error) + func ServicesUsingSecretsWith(ctx context.Context, cli *client.Client) (map[string][]swarm.Service, error) + func SetNodeAvailability(ctx context.Context, nodeID string, availability swarm.NodeAvailability) error + func SetSnapshot(s *SwarmSnapshot) + func StructFieldsAsStringArray(v interface{}) []string + func TriggerRefreshIfNeeded() + func UnlockSwarm(ctx context.Context, key string) error + func UpdateContextDescription(name, description string) error + func UpdateContextWithCertFiles(name, description, dockerHost, caFile, certFile, keyFile string, ...) error + func UseContext(contextName string) error + func ValidateContext(ctx context.Context, contextName string) error + func ValidateStackYAML(content string) error + type ClientOps interface + GetClient func() (*client.Client, error) + ResetClient func() + type ClusterInfoOps interface + GetContainerCount func() (int, error) + GetCurrentContext func() (string, error) + GetDockerVersion func() (string, error) + GetServiceCount func() (int, error) + GetSwarmCPUCapacity func() (float64, error) + GetSwarmCPUUsage func() (string, error) + GetSwarmMemCapacity func() (int64, error) + GetSwarmMemUsage func() (string, error) + GetSwarmResourceUsage func() (cpuPct, memPct string, err error) + type ComposeFile struct + Configs map[string]map[string]any + Networks map[string]map[string]any + Secrets map[string]map[string]any + Services map[string]ComposeService + Version string + Volumes map[string]map[string]any + type ComposeService struct + CapAdd []string + CapDrop []string + Command any + Configs []map[string]any + DNS []string + DNSOpt []string + DNSSearch []string + Deploy map[string]any + Entrypoint any + Environment map[string]string + Extra map[string]any + ExtraHosts []string + Healthcheck *Healthcheck + Hostname string + Image string + Init *bool + Labels map[string]string + Logging *Logging + Networks any + Ports []string + ReadOnly bool + Secrets []map[string]any + StopGracePeriod string + StopSignal string + Sysctls map[string]string + Ulimits map[string]any + User string + Volumes []string + WorkingDir string + type ConfigOps interface + CreateConfig func(ctx context.Context, name string, data []byte, labels map[string]string) (swarm.Config, error) + CreateConfigVersion func(ctx context.Context, baseConfig swarm.Config, newData []byte) (swarm.Config, error) + DeleteConfig func(ctx context.Context, nameOrID string) error + InspectConfig func(ctx context.Context, nameOrID string) (*ConfigWithDecodedData, error) + ListConfigs func(ctx context.Context) ([]swarm.Config, error) + RotateConfigInServices func(ctx context.Context, oldCfg *swarm.Config, newCfg swarm.Config) error + ServicesUsingConfigs func(ctx context.Context) (map[string][]swarm.Service, error) + type ConfigRef struct + ConfigID string + ConfigName string + File ... + type ConfigWithDecodedData struct + Config swarm.Config + Data []byte + func InspectConfig(ctx context.Context, nameOrID string) (*ConfigWithDecodedData, error) + func InspectConfigWith(ctx context.Context, cli *client.Client, nameOrID string) (*ConfigWithDecodedData, error) + func (cfg *ConfigWithDecodedData) DisplayData() []byte + func (cfg *ConfigWithDecodedData) JSON() ([]byte, error) + func (cfg *ConfigWithDecodedData) PrettyJSON() ([]byte, error) + type ContainerSpec struct + Args []string + CapabilityAdd []string + CapabilityDrop []string + Command []string + Configs []ConfigRef + DNSConfig *DNSConfig + Dir string + Env []string + Healthcheck *HealthConfigJSON + Hostname string + Hosts []string + Image string + Init *bool + Labels map[string]string + Mounts []Mount + ReadOnly bool + Secrets []SecretRef + StopGracePeriod int64 + StopSignal string + Sysctls map[string]string + Ulimits []Ulimit + User string + type ContextInfo struct + Current bool + Description string + DockerHost string + Error string + Name string + TLS bool + func ListContexts() ([]ContextInfo, error) + type ContextOps interface + CheckContextExportExists func(contextName string) bool + CreateContext func(name, dockerHost string) error + CreateContextWithCertFiles func(name, description, dockerHost, caFile, certFile, keyFile string, ...) error + CreateContextWithTLS func(name, dockerHost, tlsPath string, skipTLSVerify bool) error + DeleteContext func(contextName string) error + ExportContext func(contextName string) (string, error) + ExportContextWithForce func(contextName string) (string, error) + ImportContext func(filePath string) (string, error) + InspectContext func(contextName string) (string, error) + ListContexts func() ([]ContextInfo, error) + UpdateContextDescription func(name, description string) error + UpdateContextWithCertFiles func(name, description, dockerHost, caFile, certFile, keyFile string, ...) error + UseContext func(contextName string) error + ValidateContext func(ctx context.Context, contextName string) error + type DNSConfig struct + Nameservers []string + Options []string + Search []string + type Deps struct + Client ClientOps + ClusterInfo ClusterInfoOps + Configs ConfigOps + Contexts ContextOps + Events EventOps + Hostname HostnameOps + Inspect InspectOps + Networks NetworkOps + Nodes NodeOps + Secrets SecretOps + Services ServiceOps + Snapshot SnapshotOps + Stacks StackOps + Tasks TaskOps + Volumes VolumeOps + func DefaultDeps() Deps + type EndpointSpec struct + Mode string + Ports []PortConfig + type Event struct + Action string + Err error + Type string + func WatchEvent() Event + type EventOps interface + WatchEvent func() Event + type HealthConfigJSON struct + Interval int64 + Retries int + StartInterval int64 + StartPeriod int64 + Test []string + Timeout int64 + type Healthcheck struct + Disable bool + Interval string + Retries int + StartInterval string + StartPeriod string + Test []string + Timeout string + type HostnameOps interface + GetNodeIDToHostnameMap func() (map[string]string, error) + RefreshHostnameCache func() error + type InspectOps interface + Inspect func(ctx context.Context, t InspectType, id string) (string, error) + type InspectType string + const InspectContainer + const InspectNode + const InspectService + const InspectStack + type LogDriver struct + Name string + Options map[string]string + type Logging struct + Driver string + Options map[string]string + type Mount struct + BindOptions ... + ReadOnly bool + Source string + Target string + TmpfsOptions ... + Type string + VolumeOptions ... + type NetRef struct + Aliases []string + Target string + type NetworkOps interface + CreateNetwork func(ctx context.Context, name string, opts network.CreateOptions) (string, []string, error) + InspectNetwork func(ctx context.Context, networkID string) (network.Inspect, error) + ListNetworks func(ctx context.Context) ([]network.Summary, error) + ListServicesUsingNetwork func(ctx context.Context, networkID, networkName string) ([]string, error) + PruneNetworks func(ctx context.Context) (network.PruneReport, error) + RemoveNetwork func(ctx context.Context, networkID string) error + type NetworkWithUsage struct + Network network.Summary + Services []string + func (nw *NetworkWithUsage) JSON() ([]byte, error) + type NodeEntry struct + Addr string + Availability string + Hostname string + ID string + Labels map[string]string + Manager bool + ManagerStatus string + Role string + State string + Version string + type NodeOps interface + AddNodeLabel func(ctx context.Context, nodeID, key, value string) error + DemoteNode func(ctx context.Context, nodeID string) error + GetNodeIDToHostnameMapFromDocker func(ctx context.Context) (map[string]string, error) + PromoteNode func(ctx context.Context, nodeID string) error + RemoveNode func(ctx context.Context, nodeID string, force bool) error + RemoveNodeLabel func(ctx context.Context, nodeID, key string) error + SetNodeAvailability func(ctx context.Context, nodeID string, availability swarm.NodeAvailability) error + type PartialListError struct + NodeErrors map[string]string + Note string + func (e *PartialListError) Error() string + type Placement struct + Constraints []string + MaxReplicas *uint64 + Preferences []any + type PortConfig struct + Protocol string + PublishMode string + PublishedPort uint32 + TargetPort uint32 + type ProgressUpdate struct + Replaced int + Running int + Total int + type ResolveImage string + const ResolveImageAlways + const ResolveImageChanged + const ResolveImageDefault + const ResolveImageNever + func (r ResolveImage) Valid() bool + type ResourceSpec struct + MemoryBytes int64 + NanoCPUs int64 + Pids int64 + type Resources struct + Limits *ResourceSpec + Reservations *ResourceSpec + type RestartPolicy struct + Condition string + Delay int64 + MaxAttempts *uint64 + Window int64 + type SecretOps interface + CreateSecret func(ctx context.Context, name string, data []byte, labels map[string]string) (swarm.Secret, error) + CreateSecretVersion func(ctx context.Context, baseSecret swarm.Secret, newData []byte) (swarm.Secret, error) + DeleteSecret func(ctx context.Context, nameOrID string) error + InspectSecret func(ctx context.Context, nameOrID string) (*SecretWithDecodedData, error) + ListSecrets func(ctx context.Context) ([]swarm.Secret, error) + RotateSecretInServices func(ctx context.Context, oldSec *swarm.Secret, newSec swarm.Secret) error + ServicesUsingSecrets func(ctx context.Context) (map[string][]swarm.Service, error) + type SecretRef struct + File ... + SecretID string + SecretName string + type SecretWithDecodedData struct + Data []byte + Secret swarm.Secret + func InspectSecret(ctx context.Context, nameOrID string) (*SecretWithDecodedData, error) + func (sec *SecretWithDecodedData) JSON() ([]byte, error) + func (sec *SecretWithDecodedData) PrettyJSON() ([]byte, error) + type ServiceConvergence struct + Completed int + Desired int + Job bool + Mode string + Monitor time.Duration + Name string + NewestTaskAge time.Duration + Running int + UpdateState string + func LoadStackConvergence(stackName string) []ServiceConvergence + type ServiceEntry struct + CreatedAt time.Time + Health string + Image string + Mode string + Ports string + PullProgress string + ReplicasOnNode int + ReplicasTotal int + RollingOut bool + ServiceID string + ServiceName string + StackName string + Status string + UpToDate int + UpdatedAt time.Time + func LoadAllServices() []ServiceEntry + func LoadNodeServices(nodeID string) []ServiceEntry + func LoadStackServices(stackName string) []ServiceEntry + type ServiceInspect struct + Spec ServiceSpec + type ServiceMode struct + Global any + Replicated ... + type ServiceOps interface + CreateService func(ctx context.Context, spec swarm.ServiceSpec) (string, error) + GetServiceLogs func(ctx context.Context, serviceID string) (string, error) + GetServiceTaskDiagnostics func(ctx context.Context, serviceID string) (string, error) + LoadAllServices func() []ServiceEntry + LoadNodeServices func(nodeID string) []ServiceEntry + LoadStackServices func(stackName string) []ServiceEntry + RemoveService func(ctx context.Context, serviceName string) error + RestartService func(ctx context.Context, serviceName string) error + RestartServiceAndWait func(ctx context.Context, serviceName string) error + RestartServiceWithProgress func(ctx context.Context, serviceName string, progressCh chan<- ProgressUpdate) error + RollbackService func(ctx context.Context, serviceName string) error + ScaleService func(ctx context.Context, serviceID string, replicas uint64) error + ScaleServiceByName func(ctx context.Context, serviceName string, replicas uint64) error + type ServiceSpec struct + EndpointSpec *EndpointSpec + Labels map[string]string + Mode ServiceMode + Name string + Networks []NetRef + RollbackConfig *UpdateConfig + TaskTemplate TaskTemplate + UpdateConfig *UpdateConfig + type ServiceSummary struct + Configs []string + ContainerLabels map[string]string + CreatedAt time.Time + Healthcheck *Healthcheck + ID string + Image string + Labels map[string]string + Logging *Logging + Mode string + Name string + Ports []string + Replicas string + Secrets []string + UpdatedAt time.Time + type SnapshotOps interface + GetOrRefreshSnapshot func() (*SwarmSnapshot, error) + GetSnapshot func() *SwarmSnapshot + InvalidateSnapshot func() + RefreshSnapshot func() (*SwarmSnapshot, error) + RefreshSnapshotAsync func() + SetSnapshot func(s *SwarmSnapshot) + TriggerRefreshIfNeeded func() + type Stack struct + Name string + ServiceCount int + type StackEntry struct + Name string + NodeCount int + ServiceCount int + type StackInspection struct + Configs []string + CreatedAt time.Time + Name string + Networks []string + Secrets []string + ServiceCount int + Services []ServiceSummary + TaskCount int + UpdatedAt time.Time + Volumes []string + type StackOps interface + DeployStack func(stackName string, yamlContent string) error + InspectStack func(stackName string) (string, error) + ReconstructStackCompose func(stackName string) (string, error) + RemoveStack func(ctx context.Context, stackName string) error + RemoveStackNetworks func(ctx context.Context, stackName string) error + ValidateStackYAML func(content string) error + type StackService struct + NodeID string + ReplicasOnNode int + ReplicasTotal int + ServiceID string + ServiceName string + StackName string + type SwarmNode struct + Availability string + Hostname string + ID string + ManagerStatus string + Status string + func (s SwarmNode) String() string + type SwarmSnapshot struct + ClusterID string + Fetched time.Time + Locked bool + Nodes []swarm.Node + Services []swarm.Service + Tasks []swarm.Task + func GetOrRefreshSnapshot() (*SwarmSnapshot, error) + func GetOrRefreshSnapshotCtx(ctx context.Context) (*SwarmSnapshot, error) + func GetSnapshot() *SwarmSnapshot + func RefreshSnapshot() (*SwarmSnapshot, error) + func RefreshSnapshotCtx(ctx context.Context) (*SwarmSnapshot, error) + func SnapshotWith(parent context.Context, c client.APIClient) (*SwarmSnapshot, error) + func (s *SwarmSnapshot) FindService(serviceID string) *swarm.Service + func (s *SwarmSnapshot) FindServiceByName(name string) *swarm.Service + func (s SwarmSnapshot) ToNodeEntries() []NodeEntry + func (s SwarmSnapshot) ToStackEntries() []StackEntry + func (snap *SwarmSnapshot) DesiredReplicas(svc swarm.Service) int + func (snap *SwarmSnapshot) StackConvergence(stackName string) []ServiceConvergence + func (snap *SwarmSnapshot) StackServices(stackName string) []ServiceEntry + type TaskEntry struct + ContainerID string + ContainerState string + CreatedAt time.Time + CurrentState string + DesiredState string + Error string + Health string + ID string + Image string + Name string + NodeName string + Ports string + PullProgress string + ServiceName string + Slot int + UpdatedAt time.Time + func GetTasksForService(serviceID string) ([]TaskEntry, error) + func GetTasksForStack(stackName string) ([]TaskEntry, error) + func (t TaskEntry) StatusText() string + type TaskOps interface + GetTasksForService func(serviceID string) ([]TaskEntry, error) + GetTasksForStack func(stackName string) ([]TaskEntry, error) + type TaskTemplate struct + ContainerSpec *ContainerSpec + ForceUpdate uint64 + LogDriver *LogDriver + Networks []NetRef + Placement *Placement + Resources *Resources + RestartPolicy *RestartPolicy + type Ulimit struct + Hard int64 + Name string + Soft int64 + type UpdateConfig struct + Delay int64 + FailureAction string + MaxFailureRatio float32 + Monitor int64 + Order string + Parallelism uint64 + type VolumeInfo struct + Created time.Time + Driver string + Host string + Labels map[string]string + Mountpoint string + Name string + NodeID string + Raw *volume.Volume + Stack string + func ListVolumes(ctx context.Context) ([]VolumeInfo, error) + func ListVolumesWith(ctx context.Context, cli *client.Client) ([]VolumeInfo, error) + type VolumeOps interface + InspectVolume func(ctx context.Context, name string) (volume.Volume, error) + ListVolumes func(ctx context.Context) ([]VolumeInfo, error) v1.13.0-rc8 Aug 3, 2026 v1.13.0-rc7 Aug 1, 2026 v1.13.0-rc6 Aug 1, 2026 v1.13.0-rc5 Jul 30, 2026 v1.13.0-rc4 Jul 21, 2026 v1.13.0-rc3 Jul 21, 2026 v1.13.0-rc2 Jul 21, 2026