provider

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerAPIVersion = "1.24"
	SwarmAPIVersion  = "1.24"
)

Docker API versions.

Variables

This section is empty.

Functions

func CreateDockerClient

func CreateDockerClient(dcOps DockerClientOpts) (*client.Client, error)

CreateDockerClient creates Docker client.

Types

type ClientTLS

type ClientTLS struct {
	CA                 string
	CAOptional         bool
	Cert               string
	Key                string
	InsecureSkipVerify bool
}

ClientTLS holds TLS specific configurations as client CA, Cert and Key can be either path or file contents.

func (*ClientTLS) CreateTLSConfig

func (c *ClientTLS) CreateTLSConfig() (*tls.Config, error)

CreateTLSConfig creates a TLS config from ClientTLS structures.

type Docker

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

Docker is a Docker client.

func NewDocker

func NewDocker(dockerClient client.APIClient, traefikHost string) *Docker

NewDocker creates Docker.

func (Docker) GetIP

func (d Docker) GetIP(ctx context.Context, serviceName, network string) (string, error)

GetIP gets container IP.

func (Docker) Watch

func (d Docker) Watch(ctx context.Context, fn func(map[string]*topology.Service)) error

Watch watches docker events.

type DockerClientOpts

type DockerClientOpts struct {
	HTTPClientTimeout time.Duration
	Endpoint          string
	SwarmMode         bool
	TLSClientConfig   *ClientTLS
}

DockerClientOpts Docker client.

type DockerSwarm

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

DockerSwarm is a DockerSwarm client.

func NewDockerSwarm

func NewDockerSwarm(dockerClient client.APIClient, traefikHost string, interval time.Duration) *DockerSwarm

NewDockerSwarm creates DockerSwarm.

func (DockerSwarm) GetIP

func (d DockerSwarm) GetIP(ctx context.Context, serviceName, network string) (string, error)

GetIP gets service IP.

func (DockerSwarm) Watch

func (d DockerSwarm) Watch(ctx context.Context, fn func(map[string]*topology.Service)) error

Watch watches docker events.

Jump to

Keyboard shortcuts

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