Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) FindStoppedContainers(ctx context.Context) ([]ContainerInfo, error)
- func (c *Client) FindUnusedImages(ctx context.Context, all bool) ([]ImageInfo, error)
- func (c *Client) FindUnusedNetworks(ctx context.Context) ([]NetworkDetails, error)
- func (c *Client) FindUnusedVolumes(ctx context.Context) ([]VolumeDetails, error)
- func (c *Client) GetBuildCacheSize(ctx context.Context) (int64, error)
- func (c *Client) GetContainerStats(ctx context.Context, containers []ContainerInfo) ([]ContainerStats, error)
- func (c *Client) InspectContainer(ctx context.Context, containerID string) (*ContainerDetails, error)
- func (c *Client) ListContainers(ctx context.Context, all bool) ([]ContainerInfo, error)
- func (c *Client) ListImages(ctx context.Context, all, danglingOnly bool) ([]ImageInfo, error)
- func (c *Client) PruneBuildCache(ctx context.Context) (int64, error)
- func (c *Client) RemoveContainers(ctx context.Context, containers []ContainerInfo) (int, int64, error)
- func (c *Client) RemoveImages(ctx context.Context, images []ImageInfo) (int, int64, error)
- func (c *Client) RemoveNetworks(ctx context.Context, networks []NetworkDetails) (int, error)
- func (c *Client) RemoveVolumes(ctx context.Context, volumes []VolumeDetails) (int, int64, error)
- func (c *Client) StreamLogs(ctx context.Context, containerID string, opts LogOptions, ...) error
- type ContainerDetails
- type ContainerInfo
- type ContainerStats
- type ImageInfo
- type LogLine
- type LogOptions
- type MountInfo
- type NetworkDetails
- type NetworkInfo
- type PortMapping
- type VolumeDetails
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
func (*Client) FindStoppedContainers ¶
func (c *Client) FindStoppedContainers(ctx context.Context) ([]ContainerInfo, error)
FindStoppedContainers finds stopped containers
func (*Client) FindUnusedImages ¶
FindUnusedImages finds unused images
func (*Client) FindUnusedNetworks ¶
func (c *Client) FindUnusedNetworks(ctx context.Context) ([]NetworkDetails, error)
FindUnusedNetworks finds unused networks
func (*Client) FindUnusedVolumes ¶
func (c *Client) FindUnusedVolumes(ctx context.Context) ([]VolumeDetails, error)
FindUnusedVolumes finds unused volumes
func (*Client) GetBuildCacheSize ¶
GetBuildCacheSize gets build cache size
func (*Client) GetContainerStats ¶
func (c *Client) GetContainerStats(ctx context.Context, containers []ContainerInfo) ([]ContainerStats, error)
GetContainerStats gets statistics for containers
func (*Client) InspectContainer ¶
func (c *Client) InspectContainer(ctx context.Context, containerID string) (*ContainerDetails, error)
InspectContainer inspects a container
func (*Client) ListContainers ¶
ListContainers lists containers
func (*Client) ListImages ¶
ListImages lists Docker images
func (*Client) PruneBuildCache ¶
PruneBuildCache prunes build cache
func (*Client) RemoveContainers ¶
func (c *Client) RemoveContainers(ctx context.Context, containers []ContainerInfo) (int, int64, error)
RemoveContainers removes containers
func (*Client) RemoveImages ¶
RemoveImages removes images
func (*Client) RemoveNetworks ¶
RemoveNetworks removes networks
func (*Client) RemoveVolumes ¶
RemoveVolumes removes volumes
func (*Client) StreamLogs ¶
func (c *Client) StreamLogs(ctx context.Context, containerID string, opts LogOptions, callback func(LogLine)) error
StreamLogs streams container logs
type ContainerDetails ¶
type ContainerDetails struct {
ID string
Name string
Image string
Created string
StartedAt string
FinishedAt string
State string
Status string
Health string
HealthLog string
RestartCount int
Platform string
Command string
Entrypoint string
Env []string
Ports []PortMapping
Mounts []MountInfo
Networks map[string]NetworkInfo
Labels map[string]string
}
ContainerDetails contains detailed container information
type ContainerInfo ¶
type ContainerInfo struct {
ID string
Name string
Image string
Command string
Created string
Status string
State string
Health string
Ports []PortMapping
Size string
}
ContainerInfo contains container information
type ContainerStats ¶
type ContainerStats struct {
ID string
Name string
CPUPercent float64
MemoryUsage int64
MemoryLimit int64
MemoryPercent float64
NetInput int64
NetOutput int64
BlockInput int64
BlockOutput int64
PIDs uint64
}
ContainerStats contains container statistics
type ImageInfo ¶
type ImageInfo struct {
ID string
Repository string
Tag string
Digest string
Created string
CreatedAt time.Time
Size int64
Dangling bool
}
ImageInfo contains image information
type LogOptions ¶
type LogOptions struct {
Tail int
Follow bool
Timestamps bool
Since string
Until string
Level string
}
LogOptions contains log options
type MountInfo ¶
type MountInfo struct {
Type string
Name string
Source string
Destination string
Driver string
Mode string
RW bool
}
MountInfo contains mount information
type NetworkDetails ¶
NetworkDetails contains network details
type NetworkInfo ¶
NetworkInfo contains network information
type PortMapping ¶
PortMapping represents a port mapping
type VolumeDetails ¶
VolumeDetails contains volume details