Documentation ¶
Index ¶
- Constants
- func NewLogConsumer(ctx context.Context, w io.Writer, color bool, prefix bool) api.LogConsumer
- func Print(toJSON interface{}, format string, outWriter io.Writer, ...) error
- func PrintPrettySection(out io.Writer, printer func(writer io.Writer), headers ...string) error
- func SetANSIMode(ansi string)
- func SetMultiErrorFormat(errs *multierror.Error)
- func ToJSON(i interface{}, prefix string, indentation string) (string, error)
- func ToStandardJSON(i interface{}) (string, error)
Constants ¶
View Source
const ( // Never use ANSI codes Never = "never" // Always use ANSI codes Always = "always" // Auto detect terminal is a tty and can use ANSI codes Auto = "auto" )
View Source
const ( // JSON is the constant for Json formats on list commands JSON = "json" // TemplateLegacyJSON the legacy json formatting value using go template TemplateLegacyJSON = "{{json.}}" // PRETTY is the constant for default formats on list commands PRETTY = "pretty" )
Variables ¶
This section is empty.
Functions ¶
func NewLogConsumer ¶
NewLogConsumer creates a new LogConsumer
func Print ¶
func Print(toJSON interface{}, format string, outWriter io.Writer, writerFn func(w io.Writer), headers ...string) error
Print prints formatted lists in different formats
func PrintPrettySection ¶
PrintPrettySection prints a tabbed section on the writer parameter
func SetANSIMode ¶
func SetANSIMode(ansi string)
SetANSIMode configure formatter for colored output on ANSI-compliant console
func SetMultiErrorFormat ¶
func SetMultiErrorFormat(errs *multierror.Error)
SetMultiErrorFormat set cli default format for multi-errors
func ToStandardJSON ¶
ToStandardJSON return a string with the JSON representation of the interface{}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.