print

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesFormatter added in v0.4.12

func BytesFormatter(n *jnode.Node, columnName string) string

func RelativeTimestampFormatter

func RelativeTimestampFormatter(n *jnode.Node, columnName string) string

func TimestampFormatter

func TimestampFormatter(n *jnode.Node, columnName string) string

Types

type CSVPrinter

type CSVPrinter struct {
	PathSupport
	NoHeaders  bool
	Columns    []string
	Formatters Formatters
}

func (*CSVPrinter) PrintResult

func (p *CSVPrinter) PrintResult(w io.Writer, result *jnode.Node)

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

func NewFilter

func NewFilter(s string) Filter

type Formatter

type Formatter func(n *jnode.Node, columnName string) string

type Formatters

type Formatters map[string]Formatter

func (Formatters) Format

func (f Formatters) Format(columnName string, n *jnode.Node) string

type Interface

type Interface interface {
	PrintResult(w io.Writer, result *jnode.Node)
}

type JSONPrinter

type JSONPrinter struct{}

func (*JSONPrinter) PrintResult

func (p *JSONPrinter) PrintResult(w io.Writer, n *jnode.Node)

type NonePrinter added in v0.4.9

type NonePrinter struct{}

func (*NonePrinter) PrintResult added in v0.4.9

func (p *NonePrinter) PrintResult(w io.Writer, result *jnode.Node)

type PathSupport added in v0.4.8

type PathSupport struct {
	Filter
	Path   []string
	SortBy []string
	Limit  int
}

type TablePrinter

type TablePrinter struct {
	PathSupport
	NoHeaders  bool
	Columns    []string
	Formatters Formatters
}

func (*TablePrinter) PrintHeader

func (p *TablePrinter) PrintHeader(w io.Writer)

func (*TablePrinter) PrintResult

func (p *TablePrinter) PrintResult(w io.Writer, result *jnode.Node)

func (*TablePrinter) PrintRows

func (p *TablePrinter) PrintRows(w io.Writer, result *jnode.Node)

type ValuePrinter added in v0.4.8

type ValuePrinter struct {
	PathSupport
	Name []string
}

func NewValuePrinter added in v0.4.8

func NewValuePrinter(format string, path []string, sortBy []string) *ValuePrinter

func (*ValuePrinter) PrintResult added in v0.4.8

func (p *ValuePrinter) PrintResult(w io.Writer, result *jnode.Node)

type YAMLPrinter

type YAMLPrinter struct{}

func (*YAMLPrinter) PrintResult

func (p *YAMLPrinter) PrintResult(w io.Writer, n *jnode.Node)

Jump to

Keyboard shortcuts

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