output

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFormat = FormatJSON
View Source
const DefaultPretty = true

Variables

This section is empty.

Functions

func FormatOptions

func FormatOptions() string

func JSON

func JSON(data interface{}) (err error)

JSON allows you to override the default output method and explicitly print JSON to the screen

func Print

func Print(data interface{}) (err error)

Print outputs the data in the expected format

func SetFormat

func SetFormat(format Format) (err error)

func SetPrettyPrint

func SetPrettyPrint(pretty bool) (err error)

Types

type ConfigOption

type ConfigOption func(*Output) error

func ConfigFormat

func ConfigFormat(format Format) ConfigOption

func ConfigPrettyPrint

func ConfigPrettyPrint(pretty bool) ConfigOption

type Format

type Format uint

Format provides the list of output formats supported

const (
	FormatJSON Format = iota
	FormatYAML
)

func ParseFormat

func ParseFormat(name string) Format

func (Format) String

func (f Format) String() string

type Output

type Output struct {
	// contains filtered or unexported fields
}

Output is the main ref for the output package

func New

func New(opts ...ConfigOption) (*Output, error)

New creates a new outputter with the specific config options

Jump to

Keyboard shortcuts

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