command

package
v0.12.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddJSONOutput

func AddJSONOutput(cmd *cobra.Command)

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

func DumpJSONToSlice

func DumpJSONToSlice(data interface{}, jsonPath string) ([]byte, error)

DumpJSONToSlice dumps the contents of data into a byte slice. If jsonpath is non-empty, will attempt to do jsonpath filtering using said string. Returns byte array 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

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

func ShowProgress

func ShowProgress(ctx context.Context, cfg ProgressConfig)

Types

type ProgressConfig

type ProgressConfig struct {
	Title        string
	TotalTimeETA time.Duration
	TickInterval time.Duration
	StopFunc     func(tick int, bar *pb.ProgressBar) bool
}

Jump to

Keyboard shortcuts

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