Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) ConnectContainer(ctx context.Context, projectName, containerID string) error
- func (c *Client) CreateNetwork(ctx context.Context, projectName string) (string, error)
- func (c *Client) DeleteNetwork(ctx context.Context, projectName string) error
- func (c *Client) GetNetworkID(ctx context.Context, projectName string) (string, error)
- func (c *Client) List(ctx context.Context, projectName string) ([]ContainerInfo, error)
- func (c *Client) Logs(ctx context.Context, containerID string, opts LogsOptions) error
- func (c *Client) Remove(ctx context.Context, containerID string) error
- func (c *Client) Run(ctx context.Context, opts RunOptions) (containerID string, err error)
- func (c *Client) Stop(ctx context.Context, containerID string) error
- func (c *Client) StopAndRemove(ctx context.Context, containerID string) error
- type ContainerInfo
- type LogsOptions
- type NetworkInfo
- type RunOptions
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 SDK client with Ork-specific functionality
func (*Client) ConnectContainer ¶
ConnectContainer connects a container to the project network This must be called after the container is created but can be before or after it's started
func (*Client) CreateNetwork ¶
CreateNetwork creates a Docker network for the project All containers in the same project will be connected to this network This allows services to communicate using service names (e.g., postgres:5432)
func (*Client) DeleteNetwork ¶
DeleteNetwork removes a Docker network
func (*Client) GetNetworkID ¶ added in v0.2.0
GetNetworkID retrieves the network ID for a project Returns the network ID if it exists, empty string and error if not found
func (*Client) Logs ¶
Logs retrieves and streams container logs to stdout This is useful for debugging and monitoring container output
func (*Client) Run ¶
Run creates and starts a Docker container This orchestrates the full container lifecycle but delegates to specialized functions
type ContainerInfo ¶
type ContainerInfo struct {
ID string // Container ID (short version)
Name string // Container name
Image string // Image name
Status string // Container status (e.g., "Up 5 minutes")
Ports []string // Port mappings
Labels map[string]string // Container labels
}
ContainerInfo represents information about a running container
type LogsOptions ¶
type LogsOptions struct {
Follow bool // Stream logs continuously (like tail -f)
Tail string // Number of lines to show from the end ("all" or "100")
Timestamps bool // Show timestamps in log output
Formatter func(string) string // Optional: format each log line before output
}
LogsOptions contains configuration for retrieving container logs
type NetworkInfo ¶
NetworkInfo represents information about a Docker network
type RunOptions ¶
type RunOptions struct {
Name string // Container name
Image string // Docker image (e.g., "nginx:alpine")
Ports map[string]string // Port mappings (e.g., "8080": "80")
Env map[string]string // Environment variables
Labels map[string]string // Container labels
Command []string // Override command
Entrypoint []string // Override entrypoint
}
RunOptions contains configuration for running a container