printer

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintJSON

func PrintJSON(p Printable)

PrintJSON prints printable result as a JSON output.

func PrintTable

func PrintTable(p Printable)

PrintTable prints printable result as a table output.

Types

type Printable

type Printable interface {
	TableData() *TableData
	JSONData() interface{}
}

Printable defines contract to be implemented in order to print commands output as a JSON or Table.

type TableData

type TableData struct {
	Header       []string
	Footer       []string
	RowSeparator string
	ShowBorder   bool
	ShowRowLine  bool
	Data         [][]string
}

TableData defines print options for table output.

Jump to

Keyboard shortcuts

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