print

package
v0.0.0-...-788a008 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNewTabWriter

func GetNewTabWriter(output io.Writer) *tabwriter.Writer

GetNewTabWriter returns a tabwriter that translates tabbed columns in input into properly aligned text.

func WriteTable

func WriteTable(columns []string, obj []map[string]interface{}, output io.Writer, options *TableOptions) error

WriteTable prints a table to the provided output

Types

type TableOptions

type TableOptions struct {
	ColumnLabels *[]string
	ShowHeaders  bool
	SortBy       *string

	// If the
	AbsoluteTimestamps bool

	// The row of the Table that is active
	ActiveRow int
}

TableOptions provides default flags necessary for printing. Given the following flag values, a printer can be requested that knows how to handle printing based on these values.

func NewTableOptions

func NewTableOptions() *TableOptions

NewTableOptions returns options associated with human-readable printing, with default values set.

Jump to

Keyboard shortcuts

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