client

package
v0.0.0-...-06a57de Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package client provides Docker client initiatialisation functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContext

func CreateContext(contextName string) error

CreateContext creates a new Docker context.

func DeleteContext

func DeleteContext(name string) error

func GetConfigNames

func GetConfigNames(configs []swarm.Config) []string

func GetConfigs

func GetConfigs(cl *client.Client, ctx context.Context, server string, fs filters.Args) ([]swarm.Config, error)

func GetContext

func GetContext(contextName string) (contextStore.Metadata, error)

func GetRegistryTags

func GetRegistryTags(img reference.Named) ([]string, error)

GetRegistryTags retrieves all tags of an image from a container registry.

func GetSecretNames

func GetSecretNames(secrets []swarm.Secret) []string

func GetVolumeNames

func GetVolumeNames(volumes []*volume.Volume) []string

func GetVolumes

func GetVolumes(cl *client.Client, ctx context.Context, server string, fs filters.Args) ([]*volume.Volume, error)

func New

func New(serverName string, opts ...Opt) (*client.Client, error)

New initiates a new Docker client. New client connections are validated so that we ensure connections via SSH to the daemon can succeed. It takes into account that you may only want the local client and not communicate via SSH. For this use-case, please pass "default" as the serverName.

func RemoveConfigs

func RemoveConfigs(cl *client.Client, ctx context.Context, configNames []string, force bool) error

func RemoveVolumes

func RemoveVolumes(cl *client.Client, ctx context.Context, volumeNames []string, force bool, retries int) error

func StoreSecret

func StoreSecret(cl *client.Client, secretName, secretValue string) error

Types

type Conf

type Conf struct {
	Timeout int
}

Conf is a Docker client configuration.

type Context

type Context = contextStore.Metadata

type Opt

type Opt func(c *Conf)

Opt is a Docker client option.

func WithTimeout

func WithTimeout(timeout int) Opt

WithTimeout specifies a timeout for a Docker client.

Jump to

Keyboard shortcuts

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