Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatPorts ¶
FormatPorts renders ports as host→container, e.g. "8888→8080, 53/udp". The container port is left out if it equals the host port, the protocol unless it is udp or sctp.
Types ¶
type Details ¶
type Details struct {
ID string
Name string
Image string
ImageID string
Created time.Time
State string
Pid int
ExitCode int
OOMKilled bool
Error string
StartedAt time.Time
FinishedAt time.Time
// RestartPolicy is e.g. "always" or "on-failure:5".
RestartPolicy string
RestartCount int
Entrypoint []string
Cmd []string
WorkingDir string
User string
// Health is nil if the container has no healthcheck.
Health *Health
Networks []Network
// Ports holds the exposed ports; Public is 0 for those not published on
// the host.
Ports []Port
Mounts []Mount
Resources Resources
// Env holds the environment as KEY=value pairs.
Env []string
Labels map[string]string
}
Details is the inspect information of a single container. Zero values mean the daemon didn't report the field or it isn't set.
type Health ¶
type Health struct {
Status string
FailingStreak int
// Checks holds the most recent checks, oldest first.
Checks []HealthCheck
}
Health is the state of a container's healthcheck.
type HealthCheck ¶
HealthCheck is the result of a single healthcheck run.
type Short ¶
type Short struct {
ID string
// Project is the compose project, empty if the container wasn't started
// by compose.
Project string
Name string
Image string
Ports []Port
Status string
Age string
State string
// Health is "healthy", "unhealthy", "starting" or "none" if the container
// has no healthcheck. It is empty if the daemon doesn't report health.
Health string
}
type Stats ¶
type Stats struct {
Read time.Time
// CPUPercent is the CPU usage since the previous sample, where 100 is
// one full CPU; it goes up to 100 times OnlineCPUs.
CPUPercent float64
OnlineCPUs int
// MemUsage excludes the page cache, like docker stats does.
MemUsage uint64 // bytes
MemLimit uint64 // bytes
// NetRx and NetTx are the bytes received and sent since the container
// started, summed over all interfaces.
NetRx uint64
NetTx uint64
}
Stats is one sample of a container's resource usage. Read is zero if the container isn't running, in which case all other fields are zero too.
Click to show internal directories.
Click to hide internal directories.