Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONPrinter ¶
type JSONPrinter struct {
// contains filtered or unexported fields
}
JSONPrinter outputs data as indented JSON.
func NewJSONPrinter ¶
func NewJSONPrinter(w io.Writer) *JSONPrinter
NewJSONPrinter creates a new JSON printer.
func (*JSONPrinter) Print ¶
func (p *JSONPrinter) Print(data interface{}) error
Print outputs data as indented JSON.
func (*JSONPrinter) PrintError ¶
func (p *JSONPrinter) PrintError(err error) error
PrintError outputs an error as JSON.
type NullPrinter ¶ added in v1.3.0
type NullPrinter struct{}
NullPrinter discards all output. Used with --quiet flag.
func NewNullPrinter ¶ added in v1.3.0
func NewNullPrinter() *NullPrinter
NewNullPrinter creates a new NullPrinter.
func (*NullPrinter) Print ¶ added in v1.3.0
func (p *NullPrinter) Print(data interface{}) error
Print discards the data.
func (*NullPrinter) PrintError ¶ added in v1.3.0
func (p *NullPrinter) PrintError(err error) error
PrintError discards the error.
type TextPrinter ¶
type TextPrinter struct {
// contains filtered or unexported fields
}
TextPrinter outputs data as human-readable text.
func NewTextPrinter ¶
func NewTextPrinter(w io.Writer) *TextPrinter
NewTextPrinter creates a new text printer.
func (*TextPrinter) Print ¶
func (p *TextPrinter) Print(data interface{}) error
Print outputs data as human-readable text.
func (*TextPrinter) PrintError ¶
func (p *TextPrinter) PrintError(err error) error
PrintError outputs an error as text.
type YAMLPrinter ¶ added in v1.14.0
type YAMLPrinter struct {
// contains filtered or unexported fields
}
YAMLPrinter outputs data as YAML.
func NewYAMLPrinter ¶ added in v1.14.0
func NewYAMLPrinter(w io.Writer) *YAMLPrinter
NewYAMLPrinter creates a new YAML printer.
func (*YAMLPrinter) Print ¶ added in v1.14.0
func (p *YAMLPrinter) Print(data interface{}) error
Print outputs data as YAML.
func (*YAMLPrinter) PrintError ¶ added in v1.14.0
func (p *YAMLPrinter) PrintError(err error) error
PrintError outputs an error as YAML.