Documentation
¶
Index ¶
- Constants
- func NamespaceWrite(ctx Context, namespaces []*types.Namespace) error
- func NodeWrite(ctx Context, nodes []*types.Controller) error
- func PoolWrite(ctx Context, pools []*types.Pool) error
- func RuleWrite(ctx Context, rules []*types.Rule) error
- func VolumeWrite(ctx Context, volumes []*types.Volume, nodes []*types.Controller) error
- type Context
- type Format
- type HeaderContext
- 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 NamespaceWrite ¶
NamespaceWrite writes formatted namespaces using the Context
func NodeWrite ¶ added in v0.0.5
func NodeWrite(ctx Context, nodes []*types.Controller) error
NodeWrite writes formatted nodes using the Context
func VolumeWrite ¶
VolumeWrite writes formatted volumes 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 NewNamespaceFormat ¶
NewNamespaceFormat returns a format for use with a namespace Context
func NewNodeFormat ¶ added in v0.0.5
NewNodeFormat returns a format for use with a node Context
func NewPoolFormat ¶
NewPoolFormat returns a format for use with a pool Context
func NewRuleFormat ¶
NewRuleFormat returns a format for use with a rule 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) AddHeader ¶
func (c *HeaderContext) AddHeader(header string)
AddHeader adds another column to the header
func (*HeaderContext) FullHeader ¶
func (c *HeaderContext) FullHeader() string
FullHeader returns the header as a string