printer

package
v0.10.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTableWriter

func NewTableWriter(out io.Writer) *tabwriter.Writer

func PrintJson

func PrintJson(out io.Writer, v interface{}) error

func PrintPlaintext

func PrintPlaintext(out io.Writer, v interface{}) error

PrintPlaintext is a printer that prints the provided value as is

func PrintTable

func PrintTable(out io.Writer, v interface{}, getRow func(row interface{}) []interface{}, headers ...interface{}) error

func PrintYaml

func PrintYaml(out io.Writer, v interface{}) error

PrintYaml is a printer that prints the provided value in yaml

Types

type Format

type Format string
const (
	FormatJson      Format = "json"
	FormatTable     Format = "table"
	FormatYaml      Format = "yaml"
	FormatPlaintext Format = "plaintext"
)

type PrintOptions

type PrintOptions struct {
	RawFormat string
	Format
}

func (*PrintOptions) ParseFormat

func (p *PrintOptions) ParseFormat() error

Jump to

Keyboard shortcuts

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