formatter

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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.3

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

NewLogConsumer creates a new LogConsumer

func Print added in v0.1.20

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 v0.1.20

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

PrintPrettySection prints a tabbed section on the writer parameter

func ToJSON added in v0.1.20

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

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

func ToStandardJSON

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

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

Types

type MemBytes

type MemBytes int64

MemBytes is a type for human readable memory bytes (like 128M, 2g, etc)

func (*MemBytes) Set

func (m *MemBytes) Set(value string) error

Set sets the value of the MemBytes by passing a string

func (*MemBytes) String

func (m *MemBytes) String() string

String returns the string format of the human readable memory bytes

func (*MemBytes) Type

func (m *MemBytes) Type() string

Type returns the type

func (*MemBytes) Value

func (m *MemBytes) Value() int64

Value returns the value in int64

Jump to

Keyboard shortcuts

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