Documentation
¶
Index ¶
- func DetectProject() (string, error)
- type Client
- func (c *Client) Close() error
- func (c *Client) Context() context.Context
- func (c *Client) CreateExec(ctx context.Context, workloadID string) (ui.ExecSession, error)
- func (c *Client) Inner() *client.Client
- func (c *Client) InspectContainer(id string) (types.ContainerJSON, error)
- func (c *Client) ListContainers(project string, filterNames []string) ([]*model.Container, error)
- func (c *Client) ListProjects() ([]string, error)
- func (c *Client) ListWorkloads(ctx context.Context, scope string, filterNames []string) ([]*model.Container, error)
- func (c *Client) PauseContainer(id string) error
- func (c *Client) PauseWorkload(ctx context.Context, id string) error
- func (c *Client) ResizeExec(execID string, height, width uint) error
- func (c *Client) RestartContainer(id string) error
- func (c *Client) RestartWorkload(ctx context.Context, id string) error
- func (c *Client) StartContainer(id string) error
- func (c *Client) StartWorkload(ctx context.Context, id string) error
- func (c *Client) StopContainer(id string) error
- func (c *Client) StopWorkload(ctx context.Context, id string) error
- func (c *Client) StreamLogs(ctx context.Context, container *model.Container, since string) <-chan backend.LogMessage
- func (c *Client) UnpauseContainer(id string) error
- func (c *Client) UnpauseWorkload(ctx context.Context, id string) error
- type ExecSession
- type LogMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectProject ¶
DetectProject tries to find a Compose project name from the current directory.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Docker API client.
func NewClient ¶
NewClient creates a new Docker client connected to the local daemon. It tries the default socket first, then falls back to known Docker Desktop paths.
func (*Client) CreateExec ¶
CreateExec implements backend.Backend by creating a Docker exec session.
func (*Client) InspectContainer ¶
func (c *Client) InspectContainer(id string) (types.ContainerJSON, error)
InspectContainer returns the current state of a container.
func (*Client) ListContainers ¶
ListContainers returns containers for a given Compose project. If filterNames is non-empty, only those containers are returned.
func (*Client) ListProjects ¶
ListProjects returns all Docker Compose project names with running containers.
func (*Client) ListWorkloads ¶
func (c *Client) ListWorkloads(ctx context.Context, scope string, filterNames []string) ([]*model.Container, error)
ListWorkloads implements backend.Backend by listing Docker containers.
func (*Client) PauseContainer ¶
PauseContainer pauses a running container.
func (*Client) PauseWorkload ¶
PauseWorkload implements backend.Backend.
func (*Client) ResizeExec ¶
ResizeExec resizes the TTY for an exec session.
func (*Client) RestartContainer ¶
RestartContainer restarts a container.
func (*Client) RestartWorkload ¶
RestartWorkload implements backend.Backend.
func (*Client) StartContainer ¶
StartContainer starts a stopped container.
func (*Client) StartWorkload ¶
StartWorkload implements backend.Backend.
func (*Client) StopContainer ¶
StopContainer stops a running container.
func (*Client) StopWorkload ¶
StopWorkload implements backend.Backend.
func (*Client) StreamLogs ¶
func (c *Client) StreamLogs(ctx context.Context, container *model.Container, since string) <-chan backend.LogMessage
StreamLogs implements backend.Backend by streaming Docker container logs.
func (*Client) UnpauseContainer ¶
UnpauseContainer unpauses a paused container.
type ExecSession ¶
type ExecSession struct {
ExecID string
Conn types.HijackedResponse
}
ExecSession represents an active exec session into a container.
func (*ExecSession) Reader ¶
func (s *ExecSession) Reader() io.Reader
Reader returns a reader for the exec session output.
type LogMessage ¶
LogMessage is sent over a channel when a new log line arrives.