output

package
v0.0.0-...-76b4f34 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColoredOutput

func ColoredOutput(json [][]byte) ([]byte, error)

func ColoredUnwrappedOutput

func ColoredUnwrappedOutput(json [][]byte) ([][]byte, error)

func PrintJsonTable

func PrintJsonTable(json [][]byte) error

func PrintOutput

func PrintOutput(parsed [][]byte) error

PrintOutput prints output that is non-tabular format Depending on the input flags, it opens up a matrix of output options example json: [{"one":"01", "two":"02"},{"three":"03", "four":"04"}] -------------------+-------------------------------+------------------------------------------------------|

|  --unwrap=true                |           --unwrap=false                             |

-------------------|-------------------------------|------------------------------------------------------| --compact=true | {"one":"01","two":"02"} | [{"one":"01","two":"02"},{"three":"03","four":"04"}] |

| {"three":"03","four":"04"}    |                                                      |

-------------------|-------------------------------|------------------------------------------------------| --compact=false | { | [ |

|   "one": "01",                |   {                                                  |
|   "two": "02"                 |     "one": "01",                                     |
| }                             |     "two": "02"                                      |
| {                             |   },                                                 |
|   "three": "03",              |   {                                                  |
|   "four": "04"                |     "three": "03",                                   |
| }                             |     "four": "04"                                     |
|                               |   }                                                  |
|                               | ]                                                    |

-------------------+-------------------------------+------------------------------------------------------|

Types

type KeyProp

type KeyProp struct {
	Key          string
	Type         parser.ValueType
	MaxLen       int
	PercentWidth int
}

KeyProp defines the structure for individual columns in the table obtained by parsing the json document

Jump to

Keyboard shortcuts

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