docker

package
v0.3.2-alpha4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCheckServiceMissing = errors.New("unable to find check_service. The workers might have already been removed")
View Source
var ErrContainerNotFound = errors.New("container not found. The worker might have already been removed")
View Source
var ErrLabelIsEmpty = errors.New("label should not be empty when creating a check_service on swarm platform")

Functions

This section is empty.

Types

type Docker

type Docker struct {
	NetworkName string
	Name        string
	IsSwarm     bool
	Client      *client.Client
	Config      config.StaticConfig
}

func NewDocker

func NewDocker(cfg config.StaticConfig) (d *Docker, err error)

func (*Docker) BuildWorkerImage

func (d *Docker) BuildWorkerImage(ctx context.Context) error

func (*Docker) CommitWorkerContainerToImage

func (d *Docker) CommitWorkerContainerToImage(ctx context.Context, resp container.ContainerCreateCreatedBody, info worker.Info) (string, error)

func (*Docker) CreateService

func (d *Docker) CreateService(info worker.Info, networkName string) (types.ServiceCreateResponse, error)

func (*Docker) CreateWorkerContainer

func (d *Docker) CreateWorkerContainer(ctx context.Context, networkName string, info worker.Info) (container.ContainerCreateCreatedBody, error)

func (*Docker) DeployWorkers

func (d *Docker) DeployWorkers(ctx context.Context, info worker.Info) (err error)

func (*Docker) GetContainerByName

func (d *Docker) GetContainerByName(ctx context.Context, n string) (types.Container, error)

func (*Docker) GetServiceByName

func (d *Docker) GetServiceByName(ctx context.Context, n string) (swarm.Service, error)

func (*Docker) GetWorkerContainerStatus

func (d *Docker) GetWorkerContainerStatus(ctx context.Context, info worker.Info) (status string, err error)

func (*Docker) PullImage

func (d *Docker) PullImage(ctx context.Context) error

func (*Docker) RemoveWorkers

func (d *Docker) RemoveWorkers(ctx context.Context, info worker.Info) error

func (*Docker) StartContainer

func (d *Docker) StartContainer(ctx context.Context, resp container.ContainerCreateCreatedBody) error

func (*Docker) UploadConfigToContainer

func (d *Docker) UploadConfigToContainer(ctx context.Context, resp container.ContainerCreateCreatedBody, path string) error

Jump to

Keyboard shortcuts

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