Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) ContainerWait(ctx context.Context, id string, condition container.WaitCondition) error
- func (c *Client) Events(ctx context.Context, filters client.Filters) (<-chan events.Message, <-chan error)
- func (c *Client) ExecInContainer(ctx context.Context, containerID, command string) (int, error)
- func (c *Client) InspectContainer(ctx context.Context, id string) (*types.Container, error)
- func (c *Client) ListBackupContainers(ctx context.Context) ([]types.Container, error)
- func (c *Client) ListContainersByProject(ctx context.Context, project string) ([]types.Container, error)
- func (c *Client) StartContainer(ctx context.Context, id string) error
- func (c *Client) StopContainer(ctx context.Context, id string, timeout time.Duration) error
- func (c *Client) WatchContainer(ctx context.Context, containerID string, eventTypes ...string) (<-chan events.Message, <-chan error)
- type Event
- type EventType
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Docker Engine API client.
func New ¶
New creates a new Docker client connecting to the given host. If host is empty, the DOCKER_HOST environment variable is used.
func (*Client) ContainerWait ¶
func (c *Client) ContainerWait(ctx context.Context, id string, condition container.WaitCondition) error
ContainerWait blocks until the container reaches the given condition.
func (*Client) Events ¶
func (c *Client) Events(ctx context.Context, filters client.Filters) (<-chan events.Message, <-chan error)
Events subscribes to Docker events matching the given filters. Returns separate channels for messages and errors.
func (*Client) ExecInContainer ¶
ExecInContainer runs a command inside a container and returns its exit code.
func (*Client) InspectContainer ¶
InspectContainer returns detailed information about a container, including mounts.
func (*Client) ListBackupContainers ¶
ListBackupContainers returns all running containers that have buoy.enabled=true.
func (*Client) ListContainersByProject ¶
func (c *Client) ListContainersByProject(ctx context.Context, project string) ([]types.Container, error)
ListContainersByProject returns all containers belonging to the given compose project.
func (*Client) StartContainer ¶
StartContainer starts a container.
func (*Client) StopContainer ¶
StopContainer stops a container with the given timeout.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher watches for Docker container events and emits them on channels. It automatically reconnects on stream errors with exponential backoff.
func NewWatcher ¶
NewWatcher creates a new Watcher that uses the given Docker client.