output

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ValidTypes = []Type{TypeYAML, TypeJSON}
)

Functions

func WriteObject

func WriteObject(obj interface{}, outputType Type, out io.Writer) error

func WriteObjects

func WriteObjects(objs []interface{}, outputType Type, out io.Writer) error

Types

type Type

type Type string

OutputType specifies the type of output a command produces

const (
	// StringValueType is used for parameter values that are provided as a string.
	TypeYAML Type = "yaml"

	// ArrayValueType is used for parameter values that described an array of values.
	TypeJSON Type = "json"

	InvalidOutputError = "invalid output format, only support 'yaml' or 'json' or empty"
)

func (*Type) AsStringPtr

func (t *Type) AsStringPtr() *string

func (Type) IsFormattedOutput added in v0.17.0

func (t Type) IsFormattedOutput() bool

func (Type) Validate

func (t Type) Validate() error

Jump to

Keyboard shortcuts

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