command

package
v1.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJSONOutput added in v1.5.0

func AddJSONOutput(cmd *cobra.Command)

AddJSONOutput adds the -o|--output option to any cmd to export to json

func DumpJSONToString

func DumpJSONToString(data interface{}, jsonPath string) (string, error)

DumpJSONToString dumps the contents of data into a string. If jsonpath is non-empty, will attempt to do jsonpath filtering using said string. Returns a string containing the JSON in data, or an error if any JSON marshaling, parsing operations fail.

func ForceJSON

func ForceJSON()

ForceJSON sets output mode to JSON (for unit tests)

func OutputJSON added in v1.5.0

func OutputJSON() bool

OutputJSON returns true if the JSON output option was specified

func PrintOutput

func PrintOutput(data interface{}) error

PrintOutput receives an interface and dump the data using the --output flag. ATM only json or jsonpath. In the future yaml

func PrintOutputWithType

func PrintOutputWithType(data interface{}, outputType string) error

PrintOutputWithType receives an interface and dump the data using the --output flag. ATM only json or jsonpath. In the future yaml

Types

This section is empty.

Directories

Path Synopsis
Package exec provides useful wrappers around the standard "exec" library.
Package exec provides useful wrappers around the standard "exec" library.

Jump to

Keyboard shortcuts

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