Documentation
¶
Index ¶
Constants ¶
View Source
const ( //OutputTypePretty is used for pretty printing OutputTypePretty = "pretty" //OutputTypeRaw is used for raw output (nice for unix piping) OutputTypeRaw = "raw" //OutputTypeJSON is used for JSON output OutputTypeJSON = "json" )
Variables ¶
This section is empty.
Functions ¶
func NotImplDecorator ¶
func NotImplDecorator(ot OutputType) *notImplDecorator
NotImplDecorator can be used when a decorator is not implemented
Types ¶
type JSONDecorator ¶
type JSONDecorator struct {
// contains filtered or unexported fields
}
JSONDecorator decorates by parsing JSON
func NewJSONDecorator ¶
func NewJSONDecorator(v interface{}) *JSONDecorator
NewJSONDecorator is a decorator that outputs JSON
type Outputter ¶
Outputter is responsible for all output
func NewOutputter ¶
NewOutputter creates a new Outputter that writes to Stdout and Stderr
func (*Outputter) SetLogToDisk ¶
SetLogToDisk sets a logfile to write to
func (*Outputter) SetOutputType ¶
func (o *Outputter) SetOutputType(ot OutputType)
SetOutputType sets the output type
func (*Outputter) WriteError ¶
WriteError writes an error to errw
type TableDecorator ¶
type TableDecorator struct {
// contains filtered or unexported fields
}
TableDecorator will attempt to structure a table
func NewTableDecorator ¶
func NewTableDecorator(v interface{}, header, tmpl string) *TableDecorator
NewTableDecorator is a decorator that writes a table using golang's templating
type TmplDecorator ¶
type TmplDecorator struct {
// contains filtered or unexported fields
}
TmplDecorator decorates by simply executing a template
func NewTmplDecorator ¶
func NewTmplDecorator(v interface{}, tmpl string) *TmplDecorator
NewTmplDecorator is a decorator that uses golang's templating
Click to show internal directories.
Click to hide internal directories.