formatter

package
v1.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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 added in v1.0.8

func NewLogConsumer(ctx context.Context, w io.Writer, color bool, prefix bool) compose.LogConsumer

NewLogConsumer creates a new LogConsumer

func Print added in v1.0.8

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 added in v1.0.8

func PrintPrettySection(out io.Writer, printer func(writer io.Writer), headers ...string) error

PrintPrettySection prints a tabbed section on the writer parameter

func SetANSIMode added in v1.0.10

func SetANSIMode(ansi string)

SetANSIMode configure formatter for colored output on ANSI-compliant console

func SetMultiErrorFormat added in v0.1.16

func SetMultiErrorFormat(errs *multierror.Error)

SetMultiErrorFormat set cli default format for multi-errors

func ToJSON added in v1.0.8

func ToJSON(i interface{}, prefix string, indentation string) (string, error)

ToJSON return a string with the JSON representation of the interface{}

func ToStandardJSON added in v1.0.8

func ToStandardJSON(i interface{}) (string, error)

ToStandardJSON return a string with the JSON representation of the interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL