Documentation ¶
Index ¶
- Constants
- func ContainerStatsWrite(ctx Context, containerStats []StatsEntry, osType string) error
- func ContainerWrite(ctx Context, containers []types.Container) error
- func ImageWrite(ctx ImageContext, images []types.ImageSummary) error
- func NetworkWrite(ctx Context, networks []types.NetworkResource) error
- func PluginWrite(ctx Context, plugins []*types.Plugin) error
- func ServiceInspectWrite(ctx Context, refs []string, getRef inspect.GetRefFunc) error
- func ServiceListWrite(ctx Context, services []swarm.Service, info map[string]ServiceListInfo) error
- func TaskWrite(ctx Context, tasks []swarm.Task, names map[string]string, ...) error
- func VolumeWrite(ctx Context, volumes []*types.Volume) error
- type ContainerStats
- type Context
- type DiskUsageContext
- type Format
- func NewContainerFormat(source string, quiet bool, size bool) Format
- func NewImageFormat(source string, quiet bool, digest bool) Format
- func NewNetworkFormat(source string, quiet bool) Format
- func NewPluginFormat(source string, quiet bool) Format
- func NewServiceFormat(source string) Format
- func NewServiceListFormat(source string, quiet bool) Format
- func NewStatsFormat(source, osType string) Format
- func NewTaskFormat(source string, quiet bool) Format
- func NewVolumeFormat(source string, quiet bool) Format
- type HeaderContext
- type ImageContext
- type ServiceListInfo
- type StatsEntry
- type SubFormat
Constants ¶
const ( TableFormatKey = "table" RawFormatKey = "raw" PrettyFormatKey = "pretty" )
Format keys used to specify certain kinds of output formats
Variables ¶
This section is empty.
Functions ¶
func ContainerStatsWrite ¶
func ContainerStatsWrite(ctx Context, containerStats []StatsEntry, osType string) error
ContainerStatsWrite renders the context for a list of containers statistics
func ContainerWrite ¶
ContainerWrite renders the context for a list of containers
func ImageWrite ¶
func ImageWrite(ctx ImageContext, images []types.ImageSummary) error
ImageWrite writes the formatter images using the ImageContext
func NetworkWrite ¶
func NetworkWrite(ctx Context, networks []types.NetworkResource) error
NetworkWrite writes the context
func PluginWrite ¶
PluginWrite writes the context
func ServiceInspectWrite ¶
func ServiceInspectWrite(ctx Context, refs []string, getRef inspect.GetRefFunc) error
ServiceInspectWrite renders the context for a list of services
func ServiceListWrite ¶
ServiceListWrite writes the context
Types ¶
type ContainerStats ¶
type ContainerStats struct { StatsEntry // contains filtered or unexported fields }
ContainerStats represents an entity to store containers statistics synchronously
func NewContainerStats ¶
func NewContainerStats(container, osType string) *ContainerStats
NewContainerStats returns a new ContainerStats entity and sets in it the given name
func (*ContainerStats) GetError ¶
func (cs *ContainerStats) GetError() error
GetError returns the container statistics error. This is used to determine whether the statistics are valid or not
func (*ContainerStats) GetStatistics ¶
func (cs *ContainerStats) GetStatistics() StatsEntry
GetStatistics returns container statistics with other meta data such as the container name
func (*ContainerStats) SetError ¶
func (cs *ContainerStats) SetError(err error)
SetError sets container statistics error
func (*ContainerStats) SetErrorAndReset ¶
func (cs *ContainerStats) SetErrorAndReset(err error)
SetErrorAndReset zeroes all the container statistics and store the error. It is used when receiving time out error during statistics collecting to reduce lock overhead
func (*ContainerStats) SetStatistics ¶
func (cs *ContainerStats) SetStatistics(s StatsEntry)
SetStatistics set the container statistics
type Context ¶
type Context struct { // Output is the output stream to which the formatted string is written. Output io.Writer // Format is used to choose raw, table or custom format for the output. Format Format // Trunc when set to true will truncate the output of certain fields such as Container ID. Trunc bool // contains filtered or unexported fields }
Context contains information required by the formatter to print the output as desired.
type DiskUsageContext ¶
type DiskUsageContext struct { Context Verbose bool LayersSize int64 Images []*types.ImageSummary Containers []*types.Container Volumes []*types.Volume }
DiskUsageContext contains disk usage specific information required by the formatter, encapsulate a Context struct.
func (*DiskUsageContext) Write ¶
func (ctx *DiskUsageContext) Write()
type Format ¶
type Format string
Format is the format string rendered using the Context
func NewContainerFormat ¶
NewContainerFormat returns a Format for rendering using a Context
func NewImageFormat ¶
NewImageFormat returns a format for rendering an ImageContext
func NewNetworkFormat ¶
NewNetworkFormat returns a Format for rendering using a network Context
func NewPluginFormat ¶
NewPluginFormat returns a Format for rendering using a plugin Context
func NewServiceFormat ¶
NewServiceFormat returns a Format for rendering using a Context
func NewServiceListFormat ¶
NewServiceListFormat returns a Format for rendering using a service Context
func NewStatsFormat ¶
NewStatsFormat returns a format for rendering an CStatsContext
func NewTaskFormat ¶
NewTaskFormat returns a Format for rendering using a task Context
func NewVolumeFormat ¶
NewVolumeFormat returns a format for use with a volume Context
type HeaderContext ¶
type HeaderContext struct {
// contains filtered or unexported fields
}
HeaderContext provides the subContext interface for managing headers
func (*HeaderContext) FullHeader ¶
func (c *HeaderContext) FullHeader() interface{}
FullHeader returns the header as an interface
type ImageContext ¶
ImageContext contains image specific information required by the formatter, encapsulate a Context struct.
type ServiceListInfo ¶
ServiceListInfo stores the information about mode and replicas to be used by template
type StatsEntry ¶
type StatsEntry struct { Container string Name string ID string CPUPercentage float64 Memory float64 // On Windows this is the private working set MemoryLimit float64 // Not used on Windows MemoryPercentage float64 // Not used on Windows NetworkRx float64 NetworkTx float64 BlockRead float64 BlockWrite float64 PidsCurrent uint64 // Not used on Windows IsInvalid bool }
StatsEntry represents represents the statistics data collected from a container