docker

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComposeStackNameLabel = "com.docker.compose.project"
	SwarmStackNameLabel   = "com.docker.stack.namespace"
)

Variables

View Source
var (
	ErrUnableToPingEndpoint = errors.New("Unable to communicate with the environment")
)

Docker errors

Functions

func CreateClientFromEnv

func CreateClientFromEnv() (*client.Client, error)

func CreateSimpleClient

func CreateSimpleClient() (*client.Client, error)

Types

type ClientFactory

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

ClientFactory is used to create Docker clients

func NewClientFactory

func NewClientFactory(signatureService portainer.DigitalSignatureService, reverseTunnelService portainer.ReverseTunnelService) *ClientFactory

NewClientFactory returns a new instance of a ClientFactory

func (*ClientFactory) CreateClient

func (factory *ClientFactory) CreateClient(endpoint *portainer.Endpoint, nodeName string, timeout *time.Duration) (*client.Client, error)

CreateClient is a generic function to create a Docker client based on a specific environment(endpoint) configuration. The nodeName parameter can be used with an agent enabled environment(endpoint) to target a specific node in an agent cluster. The underlying http client timeout may be specified, a default value is used otherwise.

type Snapshotter

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

Snapshotter represents a service used to create environment(endpoint) snapshots

func NewSnapshotter

func NewSnapshotter(clientFactory *ClientFactory) *Snapshotter

NewSnapshotter returns a new Snapshotter instance

func (*Snapshotter) CreateSnapshot

func (snapshotter *Snapshotter) CreateSnapshot(endpoint *portainer.Endpoint) (*portainer.DockerSnapshot, error)

CreateSnapshot creates a snapshot of a specific Docker environment(endpoint)

Jump to

Keyboard shortcuts

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