Documentation ¶
Index ¶
- Constants
- func ServiceInspectWrite(ctx Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error
- func ServiceListWrite(ctx Context, services []swarm.Service, info map[string]ServiceListInfo) error
- func StackWrite(ctx Context, stacks []*Stack) error
- type Context
- type Format
- type HeaderContext
- type ServiceListInfo
- type Stack
- 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 ServiceInspectWrite ¶
func ServiceInspectWrite(ctx Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error
ServiceInspectWrite renders the context for a list of services
func ServiceListWrite ¶
ServiceListWrite writes the context
func StackWrite ¶
StackWrite writes formatted stacks using the Context
Types ¶
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 Format ¶
type Format string
Format is the format string rendered using the 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 NewStackFormat ¶
NewStackFormat returns a format for use with a stack 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 ServiceListInfo ¶
ServiceListInfo stores the information about mode and replicas to be used by template