Documentation
¶
Overview ¶
Package exec provides internal utilities for executing container CLI commands.
Package exec provides internal utilities for executing container CLI commands.
Index ¶
- Constants
- Variables
- func Exec(ctx context.Context, id string, args ...string) error
- func ForceRemove(ctx context.Context, id string) error
- func IsContainerNotFound(err error) bool
- func IsDeleteAlreadyDone(err error) bool
- func Logs(ctx context.Context, id string) (string, error)
- func StreamLogs(ctx context.Context, id string) (io.ReadCloser, error)
- type CliError
- type ContainerInfo
- type ContainerRawOutput
- type PublishedPort
Constants ¶
View Source
const ( StatusRunning = "running" StatusStopped = "stopped" )
Variables ¶
View Source
var ErrEmptyInspect = errors.New("empty inspect result")
ErrEmptyInspect is returned when container inspect returns an empty result, indicating the container is not yet visible to the daemon.
Functions ¶
func ForceRemove ¶
ForceRemove kills and removes a container. It is idempotent: if the container is already removed, it returns nil.
func IsContainerNotFound ¶
IsContainerNotFound checks if an error represents a "container not found" condition.
func IsDeleteAlreadyDone ¶
IsDeleteAlreadyDone checks if a delete error indicates the container was already deleted (e.g., "failed to delete one or more containers").
func StreamLogs ¶
Types ¶
type ContainerInfo ¶
type ContainerInfo struct {
Configuration struct {
ID string `json:"id"`
Labels map[string]string `json:"labels"`
PublishedPorts []PublishedPort `json:"publishedPorts"`
} `json:"configuration"`
Status string `json:"status"` // "running" or "stopped"
}
type ContainerRawOutput ¶
type ContainerRawOutput struct {
ID string
}
Click to show internal directories.
Click to hide internal directories.