Documentation ¶
Index ¶
- Constants
- func NewLogConsumer(ctx context.Context, stdout, stderr io.Writer, color, prefix, timestamp 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(streams api.Streams, 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 Print in JSON format JSON = "json" // TemplateLegacyJSON the legacy json formatting value using go template TemplateLegacyJSON = "{{json.}}" // PRETTY is the constant for default formats on list commands // Deprecated: use TABLE PRETTY = "pretty" // TABLE Print output in table format with column headers (default) TABLE = "table" )
Variables ¶
This section is empty.
Functions ¶
func NewLogConsumer ¶
func NewLogConsumer(ctx context.Context, stdout, stderr io.Writer, color, prefix, timestamp bool) api.LogConsumer
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 ¶
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.