Documentation
¶
Overview ¶
Package docker provides Docker client wrappers and container orchestration.
Index ¶
- func BuildOverlayImage(ctx context.Context, base string, ws workspace.Resolved) (string, error)
- func FormatBytes(b uint64) string
- func FormatUptime(d time.Duration) string
- func ResolveBaseImage(ctx context.Context, cfg *config.Config, version string) (string, error)
- func RunningWorkspacePorts(ctx context.Context) (map[string]int, error)
- type Client
- func (c *Client) ContainerState(ctx context.Context) (state string, exitCode int, err error)
- func (c *Client) ContainerStats(ctx context.Context) (ContainerStats, error)
- func (c *Client) CurrentContainerID(ctx context.Context) (string, error)
- func (c *Client) Down(ctx context.Context) error
- func (c *Client) Exec(ctx context.Context, args []string, env []string, stdin io.Reader, ...) error
- func (c *Client) HealthStatus(ctx context.Context) (string, error)
- func (c *Client) IsRunning(ctx context.Context) (bool, error)
- func (c *Client) Logs(ctx context.Context, follow bool, w io.Writer) error
- func (c *Client) TailLogs(ctx context.Context, n int, w io.Writer) error
- func (c *Client) Up(ctx context.Context) error
- type ContainerStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOverlayImage ¶
func FormatBytes ¶ added in v1.12.0
FormatBytes formats a byte count into a human-readable string (e.g. "1.5 GiB").
func FormatUptime ¶ added in v1.12.0
FormatUptime formats a duration into a human-readable uptime string.
func ResolveBaseImage ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ContainerState ¶ added in v1.7.0
ContainerState returns the state and exit code of the opencode container, regardless of whether it is running. Returns empty state if no container exists.
func (*Client) ContainerStats ¶ added in v1.12.0
func (c *Client) ContainerStats(ctx context.Context) (ContainerStats, error)
ContainerStats fetches a one-shot stats snapshot for the opencode container.
func (*Client) CurrentContainerID ¶
func (*Client) HealthStatus ¶ added in v1.7.0
type ContainerStats ¶ added in v1.12.0
type ContainerStats struct {
CPUPercent float64
CPULimit float64 // CPU core limit (0 = unlimited)
MemUsage uint64
MemLimit uint64
MemPercent float64
PIDsCurrent uint64
PIDsLimit uint64
NetRx uint64
NetTx uint64
BlockRead uint64
BlockWrite uint64
Uptime time.Duration
}
ContainerStats holds parsed resource consumption metrics for a container.
Click to show internal directories.
Click to hide internal directories.