Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONPrinter ¶
type JSONPrinter struct { }
JSONPrinter represents a JSON printer
func NewPrinterJSON ¶
func NewPrinterJSON(options Options) (*JSONPrinter, error)
NewPrinterJSON returns a JSON ResourcePrinter
type PlainPrinter ¶
PlainPrinter is the default "plain text" printer
func NewPrinterPlain ¶
func NewPrinterPlain(options Options) (*PlainPrinter, error)
NewPrinterPlain returns a plaintext ResourcePrinter For PlainPrinter, the option parameter contains the indent prefix.
type ResourcePrinter ¶
type ResourcePrinter interface { // PrintObj receives a runtime object, formats it and prints it to a writer. PrintObj(interface{}, io.Writer, string) error }
ResourcePrinter is an interface used to print objects.
func NewPrinter ¶
func NewPrinter(output string, options Options) (ResourcePrinter, error)
NewPrinter returns a ResourcePrinter for the specified kind of output. It returns nil if the output is not supported.
type TemplatePrinter ¶
type TemplatePrinter struct {
// contains filtered or unexported fields
}
TemplatePrinter represents a Template printer
func NewPrinterTemplate ¶
func NewPrinterTemplate(options Options) (*TemplatePrinter, error)
NewPrinterTemplate returns a Template ResourcePrinter For TemplatePrinter, the options parameter contains the template string. The "color_mode" option defines the color behaviour: it can be "auto" (default), "on" (forced), "off" (disabled).
type ThemePrinter ¶ added in v0.6.0
type ThemePrinter struct {
// contains filtered or unexported fields
}
ThemePrinter represents a Theme printer
func NewPrinterTheme ¶ added in v0.6.0
func NewPrinterTheme(options Options) (*ThemePrinter, error)
NewPrinterTheme returns a Theme ResourcePrinter For ThemePrinter, the options parameter contains the name of the theme and the template base directory (themes are assumed to be in the "themes" subdirectory). The "color_mode" option defines the color behaviour: it can be "auto" (default), "on" (forced), "off" (disabled).
type YAMLPrinter ¶
type YAMLPrinter struct { }
YAMLPrinter represents a YAML printer
func NewPrinterYAML ¶
func NewPrinterYAML(options Options) (*YAMLPrinter, error)
NewPrinterYAML returns a YAML ResourcePrinter