docker

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	DistributionInspect(ctx context.Context, image, encodedAuth string) (registry.DistributionInspect, error)
	RetrieveAuthTokenFromImage(ctx context.Context, image string) (string, error)
	ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error)
	ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error)
	Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)

	ServiceList(args *model.ServiceListArgs) ([]*model.ServiceInfo, error)
	Service(name string) (*model.ServiceInfo, error)
	TaskList(service string) ([]*model.TaskInfo, error)
}

Client for Swarm

type DockerClient added in v1.11.0

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

func NewEnvClient

func NewEnvClient() (*DockerClient, error)

NewEnvClient initializes a new Docker API client based on environment variables

func (*DockerClient) DistributionInspect added in v1.11.0

func (c *DockerClient) DistributionInspect(ctx context.Context, image, encodedAuth string) (registry.DistributionInspect, error)

DistributionInspect returns the image digest with full Manifest

func (*DockerClient) Events added in v1.11.0

func (c *DockerClient) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)

Events returns a stream of events in the daemon. It's up to the caller to close the stream by cancelling the context. Once the stream has been completely read an io.EOF error will be sent over the error channel. If an error is sent all processing will be stopped. It's up to the caller to reopen the stream in the event of an error by reinvoking this method.

func (*DockerClient) RetrieveAuthTokenFromImage added in v1.11.0

func (c *DockerClient) RetrieveAuthTokenFromImage(ctx context.Context, image string) (string, error)

RetrieveAuthTokenFromImage retrieves an encoded auth token given a complete image

func (*DockerClient) Service added in v1.11.0

func (c *DockerClient) Service(name string) (*model.ServiceInfo, error)

Service returns a service

func (*DockerClient) ServiceInspectWithRaw added in v1.11.0

func (c *DockerClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error)

ServiceInspectWithRaw returns the service information and the raw data.

func (*DockerClient) ServiceList added in v1.11.0

func (c *DockerClient) ServiceList(args *model.ServiceListArgs) ([]*model.ServiceInfo, error)

ServiceList return all services.

func (*DockerClient) ServiceUpdate added in v1.11.0

func (c *DockerClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error)

ServiceUpdate updates a Service. The version number is required to avoid conflicting writes. It should be the value as set *before* the update. You can find this value in the Meta field of swarm.Service, which can be found using ServiceInspectWithRaw.

func (*DockerClient) TaskList added in v1.11.0

func (c *DockerClient) TaskList(service string) ([]*model.TaskInfo, error)

TaskList return all running tasks of a service.

Jump to

Keyboard shortcuts

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