Documentation
¶
Index ¶
- type Client
- func (c *Client) BuildImage(buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
- func (c *Client) Close() error
- func (c *Client) ComposeBuild(projectPath string, services []string) error
- func (c *Client) ComposeBuildWithProgress(projectPath string, services []string, progressCb ProgressCallback) error
- func (c *Client) ComposeDown(projectPath string, removeVolumes bool) error
- func (c *Client) ComposeExec(projectPath string, service string, command []string) error
- func (c *Client) ComposeLogs(projectPath string, service string, tail string) ([]string, error)
- func (c *Client) ComposePs(projectPath string) ([]string, error)
- func (c *Client) ComposePull(projectPath string, services []string) error
- func (c *Client) ComposePullWithProgress(projectPath string, services []string, progressCb ProgressCallback) error
- func (c *Client) ComposePush(projectPath string, services []string) error
- func (c *Client) ComposePushWithProgress(projectPath string, services []string, progressCb ProgressCallback) error
- func (c *Client) ComposeRestart(projectPath string, services []string) error
- func (c *Client) ComposeScale(projectPath string, service string, replicas int) error
- func (c *Client) ComposeStart(projectPath string, services []string) error
- func (c *Client) ComposeStop(projectPath string, services []string) error
- func (c *Client) ComposeUp(projectPath string, detached bool) error
- func (c *Client) ConnectContainerToNetwork(networkID, containerID string) error
- func (c *Client) CreateNetwork(name string, driver string) (network.CreateResponse, error)
- func (c *Client) CreateVolume(name string, driver string, labels map[string]string) (volume.Volume, error)
- func (c *Client) DisconnectContainerFromNetwork(networkID, containerID string, force bool) error
- func (c *Client) ExecAttach(execID string) (types.HijackedResponse, error)
- func (c *Client) ExecContainer(containerID string, cmd []string) (types.IDResponse, error)
- func (c *Client) ExecInspect(execID string) (container.ExecInspect, error)
- func (c *Client) ExecInteractive(containerID string, shell string) error
- func (c *Client) ExecStart(execID string) error
- func (c *Client) FindComposeFiles(startPath string) ([]string, error)
- func (c *Client) GetContainerLogs(containerID string, follow bool, tail string) (io.ReadCloser, error)
- func (c *Client) GetContainerStats(containerID string, stream bool) (container.StatsResponseReader, error)
- func (c *Client) GetDiskUsage() (types.DiskUsage, error)
- func (c *Client) GetEvents() (<-chan events.Message, <-chan error)
- func (c *Client) GetImageHistory(imageID string) ([]image.HistoryResponseItem, error)
- func (c *Client) GetSystemInfo() (system.Info, error)
- func (c *Client) GetVersion() (types.Version, error)
- func (c *Client) InspectContainer(containerID string) (types.ContainerJSON, error)
- func (c *Client) InspectImage(imageID string) (types.ImageInspect, error)
- func (c *Client) InspectNetwork(networkID string) (network.Inspect, error)
- func (c *Client) InspectVolume(volumeName string) (volume.Volume, error)
- func (c *Client) ListComposeProjects() ([]ComposeProject, error)
- func (c *Client) ListContainers(all bool) ([]types.Container, error)
- func (c *Client) ListImages() ([]image.Summary, error)
- func (c *Client) ListNetworks() ([]network.Summary, error)
- func (c *Client) ListVolumes() (volume.ListResponse, error)
- func (c *Client) PauseContainer(containerID string) error
- func (c *Client) Ping() error
- func (c *Client) PruneImages() (image.PruneReport, error)
- func (c *Client) PruneVolumes() (volume.PruneReport, error)
- func (c *Client) PullImage(imageName string) (io.ReadCloser, error)
- func (c *Client) PushImage(imageName string) (io.ReadCloser, error)
- func (c *Client) ReadComposeFile(configPath string) (string, error)
- func (c *Client) RemoveContainer(containerID string, force bool) error
- func (c *Client) RemoveImage(imageID string, force bool) ([]image.DeleteResponse, error)
- func (c *Client) RemoveNetwork(networkID string) error
- func (c *Client) RemoveVolume(volumeName string, force bool) error
- func (c *Client) RestartContainer(containerID string, timeout *int) error
- func (c *Client) RunContainer(command string) error
- func (c *Client) StartContainer(containerID string) error
- func (c *Client) StopContainer(containerID string, timeout *int) error
- func (c *Client) TagImage(source, target string) error
- func (c *Client) UnpauseContainer(containerID string) error
- func (c *Client) ValidateComposePath(path string) error
- type ComposeProject
- type ComposeService
- type ProgressCallback
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 client and provides high-level operations
func (*Client) BuildImage ¶
func (c *Client) BuildImage(buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
BuildImage builds an image from a Dockerfile
func (*Client) ComposeBuild ¶
ComposeBuild runs 'docker compose build' in the specified directory
func (*Client) ComposeBuildWithProgress ¶
func (c *Client) ComposeBuildWithProgress(projectPath string, services []string, progressCb ProgressCallback) error
ComposeBuildWithProgress runs 'docker compose build' with progress updates
func (*Client) ComposeDown ¶
ComposeDown runs 'docker compose down' in the specified directory
func (*Client) ComposeExec ¶
ComposeExec executes a command in a running compose service container
func (*Client) ComposeLogs ¶
ComposeLogs retrieves logs from compose services
func (*Client) ComposePull ¶
ComposePull runs 'docker compose pull' in the specified directory
func (*Client) ComposePullWithProgress ¶
func (c *Client) ComposePullWithProgress(projectPath string, services []string, progressCb ProgressCallback) error
ComposePullWithProgress runs 'docker compose pull' with progress updates
func (*Client) ComposePush ¶
ComposePush runs 'docker compose push' in the specified directory
func (*Client) ComposePushWithProgress ¶
func (c *Client) ComposePushWithProgress(projectPath string, services []string, progressCb ProgressCallback) error
ComposePushWithProgress runs 'docker compose push' with progress updates
func (*Client) ComposeRestart ¶
ComposeRestart runs 'docker compose restart' in the specified directory
func (*Client) ComposeScale ¶
ComposeScale scales a service to the specified number of replicas
func (*Client) ComposeStart ¶
ComposeStart runs 'docker compose start' in the specified directory
func (*Client) ComposeStop ¶
ComposeStop runs 'docker compose stop' in the specified directory
func (*Client) ConnectContainerToNetwork ¶
ConnectContainerToNetwork connects a container to a network
func (*Client) CreateNetwork ¶
CreateNetwork creates a new network
func (*Client) CreateVolume ¶
func (c *Client) CreateVolume(name string, driver string, labels map[string]string) (volume.Volume, error)
CreateVolume creates a new volume
func (*Client) DisconnectContainerFromNetwork ¶
DisconnectContainerFromNetwork disconnects a container from a network
func (*Client) ExecAttach ¶
func (c *Client) ExecAttach(execID string) (types.HijackedResponse, error)
ExecAttach attaches to an exec instance and returns the connection
func (*Client) ExecContainer ¶
ExecContainer executes a command in a running container
func (*Client) ExecInspect ¶
func (c *Client) ExecInspect(execID string) (container.ExecInspect, error)
ExecInspect inspects an exec instance
func (*Client) ExecInteractive ¶
ExecInteractive executes an interactive shell in a container This function will take over the terminal, allowing the user to interact with the shell
func (*Client) FindComposeFiles ¶
FindComposeFiles finds docker-compose.yml files in the specified directory
func (*Client) GetContainerLogs ¶
func (c *Client) GetContainerLogs(containerID string, follow bool, tail string) (io.ReadCloser, error)
GetContainerLogs retrieves container logs
func (*Client) GetContainerStats ¶
func (c *Client) GetContainerStats(containerID string, stream bool) (container.StatsResponseReader, error)
GetContainerStats returns real-time stats for a container
func (*Client) GetDiskUsage ¶
GetDiskUsage returns disk usage information
func (*Client) GetImageHistory ¶
func (c *Client) GetImageHistory(imageID string) ([]image.HistoryResponseItem, error)
GetImageHistory returns the history of an image
func (*Client) GetSystemInfo ¶
GetSystemInfo returns Docker system information
func (*Client) GetVersion ¶
GetVersion returns Docker version information
func (*Client) InspectContainer ¶
func (c *Client) InspectContainer(containerID string) (types.ContainerJSON, error)
InspectContainer returns detailed container information
func (*Client) InspectImage ¶
func (c *Client) InspectImage(imageID string) (types.ImageInspect, error)
InspectImage returns detailed image information
func (*Client) InspectNetwork ¶
InspectNetwork returns detailed network information
func (*Client) InspectVolume ¶
InspectVolume returns detailed volume information
func (*Client) ListComposeProjects ¶
func (c *Client) ListComposeProjects() ([]ComposeProject, error)
ListComposeProjects lists all Docker Compose projects by looking for containers with compose labels
func (*Client) ListContainers ¶
ListContainers returns all containers (running and stopped)
func (*Client) ListImages ¶
ListImages returns all images
func (*Client) ListNetworks ¶
ListNetworks returns all networks
func (*Client) ListVolumes ¶
func (c *Client) ListVolumes() (volume.ListResponse, error)
ListVolumes returns all volumes
func (*Client) PauseContainer ¶
PauseContainer pauses a container
func (*Client) PruneImages ¶
func (c *Client) PruneImages() (image.PruneReport, error)
PruneImages removes unused images
func (*Client) PruneVolumes ¶
func (c *Client) PruneVolumes() (volume.PruneReport, error)
PruneVolumes removes unused volumes
func (*Client) PullImage ¶
func (c *Client) PullImage(imageName string) (io.ReadCloser, error)
PullImage pulls an image from a registry
func (*Client) PushImage ¶
func (c *Client) PushImage(imageName string) (io.ReadCloser, error)
PushImage pushes an image to a registry
func (*Client) ReadComposeFile ¶
ReadComposeFile reads the contents of a compose file
func (*Client) RemoveContainer ¶
RemoveContainer removes a container
func (*Client) RemoveImage ¶
RemoveImage removes an image
func (*Client) RemoveNetwork ¶
RemoveNetwork removes a network
func (*Client) RemoveVolume ¶
RemoveVolume removes a volume
func (*Client) RestartContainer ¶
RestartContainer restarts a container
func (*Client) RunContainer ¶
RunContainer creates and starts a container from a docker run command
func (*Client) StartContainer ¶
StartContainer starts a container
func (*Client) StopContainer ¶
StopContainer stops a container
func (*Client) UnpauseContainer ¶
UnpauseContainer unpauses a container
func (*Client) ValidateComposePath ¶
ValidateComposePath checks if a compose file exists at the given path
type ComposeProject ¶
type ComposeProject struct {
Name string
ConfigPath string
Status string
Services []ComposeService
}
ComposeProject represents a Docker Compose project
type ComposeService ¶
type ComposeService struct {
Name string
Image string
Status string
Replicas int
Ports []string
ContainerID string
}
ComposeService represents a service in a Docker Compose project
type ProgressCallback ¶
type ProgressCallback func(message string)
ProgressCallback is a function type for progress updates