output

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(objects map[interface{}]interface{}, outputFilter []string) map[interface{}]interface{}

Types

type Ack

type Ack struct {
	Sections map[string][]interface{}
}

func (*Ack) AddItem

func (a *Ack) AddItem(section string, item string)

func (*Ack) AddSection

func (a *Ack) AddSection(name string, items []interface{})

func (*Ack) InitSection

func (a *Ack) InitSection(name string)

func (*Ack) Print

func (a *Ack) Print()

type AckBinding

type AckBinding func(map[interface{}]interface{}, *Ack)

type GoTmpl

type GoTmpl struct {
	Objects map[interface{}]interface{}
	Format  string
}

func NewGoTmpl

func NewGoTmpl(objects map[interface{}]interface{}, format string) *GoTmpl

func (*GoTmpl) Print

func (m *GoTmpl) Print()

type JSON

type JSON struct {
	Objects map[interface{}]interface{}
	Format  string
}

func NewJSON

func NewJSON(objects map[interface{}]interface{}, format string) *JSON

func (*JSON) Print

func (j *JSON) Print()

type Output

type Output struct {
	Type         string
	Filter       []string
	Format       string
	TableBinding *TableBinding
	AckBinding   AckBinding
}

func (*Output) AddFlags

func (o *Output) AddFlags(cmd *cobra.Command, defaultOutput string)

func (*Output) OutputTypes

func (o *Output) OutputTypes() []string

func (*Output) OutputTypesString

func (o *Output) OutputTypesString() string

func (*Output) Print

func (o *Output) Print(objects map[interface{}]interface{})

type Table

type Table struct {
	Headings []interface{}
	Rows     [][]interface{}
}

func NewTable

func NewTable(headings []interface{}, rows [][]interface{}) *Table

func TableFromObjects

func TableFromObjects(objects map[interface{}]interface{}, headings []string, processObjects func(map[interface{}]interface{}, *Table)) *Table

func (*Table) AddHeadings

func (t *Table) AddHeadings(headings ...interface{})

func (*Table) AddHeadingsS

func (t *Table) AddHeadingsS(headings ...string)

func (*Table) AddRow

func (t *Table) AddRow(rowValues ...interface{})

func (*Table) AddRowS

func (t *Table) AddRowS(rowValues ...string)

func (*Table) Print

func (t *Table) Print()

type TableBinding

type TableBinding struct {
	Headings       []string
	ProcessObjects func(map[interface{}]interface{}, *Table)
}

Jump to

Keyboard shortcuts

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