Documentation ¶
Index ¶
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 Ellipsis ¶
Ellipsis truncates a string to fit within maxDisplayWidth, and appends ellipsis (…). For maxDisplayWidth of 1 and lower, no ellipsis is appended. For maxDisplayWidth of 1, first char of string will return even if its width > 1.
func PluginWrite ¶
PluginWrite writes the context
func SearchWrite ¶
SearchWrite writes 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 NewPluginFormat ¶
NewPluginFormat returns a Format for rendering using a plugin Context
func NewSearchFormat ¶
NewSearchFormat returns a Format for rendering using a network 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