Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Command string `json:"command"`
Created time.Time `json:"created"`
Status string `json:"status"`
State string `json:"state"`
Health string `json:"health,omitempty"`
Ports []Port `json:"ports"`
Labels map[string]string `json:"labels,omitempty"`
Running bool `json:"running"`
}
Container holds normalized data for a single Docker container.
func (Container) ComposeProject ¶
ComposeProject returns the Docker Compose project name, if any.
type ContainerLister ¶
type ContainerLister interface {
ListContainers(ctx context.Context, all bool) ([]Container, error)
}
ContainerLister abstracts Docker container listing for testability.
type DockerClient ¶
type DockerClient struct {
// contains filtered or unexported fields
}
DockerClient implements ContainerLister using the real Docker Engine API.
func NewDockerClient ¶
func NewDockerClient() (*DockerClient, error)
NewDockerClient creates a client that talks to the local Docker daemon.
func (*DockerClient) Close ¶
func (d *DockerClient) Close() error
Close releases the underlying Docker client resources.
func (*DockerClient) ListContainers ¶
ListContainers returns all (or only running) containers from the Docker daemon.
Click to show internal directories.
Click to hide internal directories.