output

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpperSnake

func UpperSnake(header string) string

Types

type HeaderFormatter

type HeaderFormatter func(string) string

type Pager

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

func NewPager

func NewPager(bin string, out io.Writer) (*Pager, error)

func (*Pager) Close

func (p *Pager) Close() error

func (*Pager) Write

func (p *Pager) Write(b []byte) (n int, err error)

type Row

type Row map[string]interface{}

func NewRow added in v0.2.2

func NewRow(data map[string]interface{}) Row

func (Row) AddField added in v0.2.2

func (r Row) AddField(name string, val interface{})

func (Row) ValueString added in v0.2.2

func (r Row) ValueString(name string) string

type RowDataProvider added in v0.2.2

type RowDataProvider interface {
	ProvideRowData() map[string]interface{}
}

type RowModifier added in v0.2.0

type RowModifier func(Row) Row

func WithAdditionalFields added in v0.2.0

func WithAdditionalFields(fields map[string]interface{}) RowModifier

type Table

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

func NewTable

func NewTable(opts ...TableOption) (*Table, error)

func (*Table) Flush

func (t *Table) Flush() error

func (*Table) Write

func (t *Table) Write(r RowDataProvider, mods ...RowModifier) error

type TableConfig

type TableConfig struct {
	Out        io.Writer
	Columns    []string
	HFormatter HeaderFormatter
	NoColor    bool
	NoHeaders  bool
	PagerBin   string
}

func (*TableConfig) Default

func (c *TableConfig) Default()

func (*TableConfig) Option

func (c *TableConfig) Option(opts ...TableOption)

type TableOption

type TableOption interface {
	ConfigureTable(*TableConfig)
}

type WithColumns

type WithColumns string

func (WithColumns) ConfigureTable added in v0.2.2

func (wc WithColumns) ConfigureTable(c *TableConfig)

type WithHeaderFormatter

type WithHeaderFormatter HeaderFormatter

func (WithHeaderFormatter) ConfigureTable added in v0.2.2

func (wh WithHeaderFormatter) ConfigureTable(c *TableConfig)

type WithNoColor added in v0.2.2

type WithNoColor bool

func (WithNoColor) ConfigureTable added in v0.2.2

func (wn WithNoColor) ConfigureTable(c *TableConfig)

type WithNoHeaders

type WithNoHeaders bool

func (WithNoHeaders) ConfigureTable added in v0.2.2

func (wn WithNoHeaders) ConfigureTable(c *TableConfig)

type WithOutput

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

func (WithOutput) ConfigureTable added in v0.2.2

func (wo WithOutput) ConfigureTable(c *TableConfig)

type WithPager

type WithPager string

func (WithPager) ConfigureTable added in v0.2.2

func (wp WithPager) ConfigureTable(c *TableConfig)

Jump to

Keyboard shortcuts

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