Documentation
¶
Overview ¶
Package dockerctl is a minimal Docker Engine API client over the local unix socket, enough for the index-sync cycle to quiesce and restart the compose brain service: find one container by compose labels, stop it, start it, inspect its running/health state. Stdlib only — the full docker SDK is a heavy dependency for four endpoints (go-research: reuse first, but YAGNI).
Index ¶
- Constants
- type Client
- func (c *Client) FindOne(ctx context.Context, labels map[string]string) (string, error)
- func (c *Client) Inspect(ctx context.Context, id string) (running bool, health string, err error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) Start(ctx context.Context, id string) error
- func (c *Client) Stop(ctx context.Context, id string, timeoutSec int) error
- func (c *Client) WaitHealthy(ctx context.Context, id string, timeout time.Duration) error
Constants ¶
const DefaultSocket = "/var/run/docker.sock"
DefaultSocket is the Docker daemon socket path mounted into the loop service.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the Docker Engine API.
func NewHTTP ¶
NewHTTP returns a client against a concrete base URL with a caller HTTP client. Used by tests against an httptest server (real HTTP).
func (*Client) FindOne ¶
FindOne returns the id of the single container matching every label (key=value). Zero or several matches is an error: the loop must target one deterministic container.
func (*Client) Inspect ¶
Inspect reports whether the container is running and its health status (empty when the container declares no healthcheck).