Documentation
¶
Index ¶
- Variables
- func BuildMount(source, target string, readOnly bool) mount.Mount
- func ExtractBindMountErrorMsg(err error) string
- func ExtractNetworkErrorMsg(err error) string
- func ExtractPortErrorMsg(err error) string
- func Provide(i *do.Injector)
- type ContainerRunOptions
- type Docker
- func (d *Docker) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
- func (d *Docker) ContainerList(ctx context.Context, opts container.ListOptions) ([]types.Container, error)
- func (d *Docker) ContainerLogs(ctx context.Context, w io.Writer, containerID string, ...) error
- func (d *Docker) ContainerRemove(ctx context.Context, containerID string, opts container.RemoveOptions) error
- func (d *Docker) ContainerRun(ctx context.Context, opts ContainerRunOptions) (string, error)
- func (d *Docker) ContainerStop(ctx context.Context, containerID string, timeoutSeconds *int) error
- func (d *Docker) ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition, ...) error
- func (d *Docker) Exec(ctx context.Context, w io.Writer, containerID string, command []string) error
- func (d *Docker) GetContainerByLabels(ctx context.Context, labels map[string]string) (types.Container, error)
- func (d *Docker) HealthCheck() common.ComponentStatus
- func (d *Docker) Info(ctx context.Context) (system.Info, error)
- func (d *Docker) NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (string, error)
- func (d *Docker) NetworkInspect(ctx context.Context, name string, options network.InspectOptions) (network.Inspect, error)
- func (d *Docker) NetworkRemove(ctx context.Context, networkID string) error
- func (d *Docker) NodeList(ctx context.Context) ([]swarm.Node, error)
- func (d *Docker) ServiceDeploy(ctx context.Context, spec swarm.ServiceSpec) (ServiceDeployResult, error)
- func (d *Docker) ServiceInspect(ctx context.Context, serviceID string) (swarm.Service, error)
- func (d *Docker) ServiceInspectByLabels(ctx context.Context, labels map[string]string) (swarm.Service, error)
- func (d *Docker) ServiceList(ctx context.Context, opts types.ServiceListOptions) ([]swarm.Service, error)
- func (d *Docker) ServiceRemove(ctx context.Context, serviceID string) error
- func (d *Docker) ServiceRestart(ctx context.Context, serviceID string, targetScale uint64, ...) error
- func (d *Docker) ServiceScale(ctx context.Context, opts ServiceScaleOptions) error
- func (d *Docker) Shutdown() error
- func (d *Docker) TasksByServiceID(ctx context.Context) (map[string][]swarm.Task, error)
- func (d *Docker) WaitForService(ctx context.Context, serviceID string, timeout time.Duration, ...) error
- type NetworkInfo
- type ServiceDeployResult
- type ServiceScaleOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found error")
View Source
var ErrProcessNotFound = errors.New("matching process not found")
Functions ¶
func ExtractBindMountErrorMsg ¶
ExtractBindError extracts the bind error message from the given error if it is a bind error. Otherwise, returns an empty string.
func ExtractNetworkErrorMsg ¶
func ExtractPortErrorMsg ¶
ExtractPortErrorMsg extracts the port bind error message from the given error if it is a port bind or allocation error. Otherwise, returns an empty string.
Types ¶
type ContainerRunOptions ¶
type ContainerRunOptions struct {
Config *container.Config
Host *container.HostConfig
Net *network.NetworkingConfig
Platform *v1.Platform
Name string
}
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
func (*Docker) ContainerInspect ¶
func (*Docker) ContainerList ¶
func (*Docker) ContainerLogs ¶
func (*Docker) ContainerRemove ¶
func (*Docker) ContainerRun ¶
func (*Docker) ContainerStop ¶
func (*Docker) ContainerWait ¶
func (*Docker) GetContainerByLabels ¶
func (*Docker) HealthCheck ¶
func (d *Docker) HealthCheck() common.ComponentStatus
func (*Docker) NetworkCreate ¶
func (*Docker) NetworkInspect ¶
func (*Docker) NetworkRemove ¶
func (*Docker) ServiceDeploy ¶
func (d *Docker) ServiceDeploy(ctx context.Context, spec swarm.ServiceSpec) (ServiceDeployResult, error)
func (*Docker) ServiceInspect ¶
func (*Docker) ServiceInspectByLabels ¶
func (*Docker) ServiceList ¶
func (*Docker) ServiceRemove ¶
func (*Docker) ServiceRestart ¶
func (*Docker) ServiceScale ¶
func (d *Docker) ServiceScale(ctx context.Context, opts ServiceScaleOptions) error
func (*Docker) TasksByServiceID ¶
func (*Docker) WaitForService ¶
func (d *Docker) WaitForService(ctx context.Context, serviceID string, timeout time.Duration, previous swarm.Version) error
WaitForService waits until the given service achieves the desired state and number of tasks. The Swarm API can return stale data before the updated spec has propagated to all manager nodes, so the optional 'previous swarm.Version' parameter can be used to detect stale reads.
type NetworkInfo ¶
func ExtractNetworkInfo ¶
func ExtractNetworkInfo(info network.Inspect) (*NetworkInfo, error)
type ServiceDeployResult ¶
Click to show internal directories.
Click to hide internal directories.