Documentation
¶
Index ¶
- type Client
- type DockerClient
- func (c *DockerClient) DistributionInspect(ctx context.Context, image, encodedAuth string) (registry.DistributionInspect, error)
- func (c *DockerClient) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)
- func (c *DockerClient) RetrieveAuthTokenFromImage(ctx context.Context, image string) (string, error)
- func (c *DockerClient) Service(name string) (*model.ServiceInfo, error)
- func (c *DockerClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error)
- func (c *DockerClient) ServiceList(args *model.ServiceListArgs) ([]*model.ServiceInfo, error)
- func (c *DockerClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, ...) (types.ServiceUpdateResponse, error)
- func (c *DockerClient) TaskList(service string) ([]*model.TaskInfo, error)
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.