Documentation
¶
Index ¶
- func PrintJson(i interface{}, writer io.Writer) error
- func PrintOutputJsonOrYaml(output string, i interface{}, writer io.Writer) (bool, error)
- func PrintTable(columns []string, rows [][]string, writer io.Writer)
- func PrintTableJsonPath(jsonStrings []string, columns []string, columnsPaths map[string]string, ...)
- func PrintYaml(i interface{}, writer io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintOutputJsonOrYaml ¶
PrintOutputJsonOrYaml will print json or yaml to writer based on output value
func PrintTableJsonPath ¶
func PrintTableJsonPath(jsonStrings []string, columns []string, columnsPaths map[string]string, writer io.Writer)
PrintTableJsonPath will print a table with the supplied JSON data and map into the supplied Writer. The map contains the header and the json path to use access the value. The table printed will be something like: +---------------+---------------+ | COLUMN NAME 1 | COLUMN NAME 2 | +---------------+---------------+ | Some data 1 | Some data 1 | | Some data 2 | Some data 2 | +-------------------+-----------+ The function accepts a gjson query for columnsPaths instead of data, so it can query the each json string passed in
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.