Documentation ¶
Index ¶
- Variables
- func AddJSONOutput(cmd *cobra.Command)
- func DumpJSONToSlice(data interface{}, jsonPath string) ([]byte, error)
- func ForceJSON()
- func OutputJSON() bool
- func PrintOutput(data interface{}) error
- func PrintOutputWithType(data interface{}, outputType string) error
- func ShowProgress(ctx context.Context, cfg ProgressConfig)
- type ProgressConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTableStyle = table.Style{ Name: "Default", Box: table.StyleBoxDefault, Color: table.ColorOptionsDefault, Format: table.FormatOptionsDefault, HTML: table.DefaultHTMLOptions, Options: table.OptionsNoBordersAndSeparators, Title: table.TitleOptionsDefault, }
Functions ¶
func AddJSONOutput ¶
AddJSONOutput adds the -o|--output option to any cmd to export to json
func DumpJSONToSlice ¶
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 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 ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.