Documentation
¶
Index ¶
- type OutputFormat
- type OutputFormatter
- type OutputFormatterTable
- func (oft *OutputFormatterTable) AppendRow(row []interface{})
- func (oft *OutputFormatterTable) AppendRows(rows [][]interface{})
- func (oft *OutputFormatterTable) SetColumnWidthMax(widthMax []int)
- func (oft *OutputFormatterTable) SetHeader(header []string)
- func (oft *OutputFormatterTable) ToObject() OutputFormatterTableObject
- type OutputFormatterTableObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OutputFormat ¶
type OutputFormat string
const ( // format OutputFormatTable OutputFormat = "table" OutputFormatTSV OutputFormat = "tsv" OutputFormatCSV OutputFormat = "csv" OutputFormatJSON OutputFormat = "json" OutputFormatLegacy OutputFormat = "legacy" )
func GetOutputFormat ¶
func GetOutputFormat(order string) OutputFormat
GetOutputFormat returns OutputFormat from string
type OutputFormatter ¶
type OutputFormatter struct {
Writer io.Writer
Tables []OutputFormatterTable
}
func NewOutputFormatter ¶
func NewOutputFormatter(writer io.Writer) *OutputFormatter
func (*OutputFormatter) GetCurrentTable ¶
func (of *OutputFormatter) GetCurrentTable() *OutputFormatterTable
func (*OutputFormatter) GetJSON ¶
func (of *OutputFormatter) GetJSON(pretty bool) string
func (*OutputFormatter) NewTable ¶
func (of *OutputFormatter) NewTable(title string) *OutputFormatterTable
func (*OutputFormatter) Render ¶
func (of *OutputFormatter) Render(format OutputFormat)
func (*OutputFormatter) RenderJSON ¶
func (of *OutputFormatter) RenderJSON()
type OutputFormatterTable ¶
type OutputFormatterTable struct {
Title string
Header []string
WidthMax []int
Rows [][]interface{}
}
func (*OutputFormatterTable) AppendRow ¶
func (oft *OutputFormatterTable) AppendRow(row []interface{})
func (*OutputFormatterTable) AppendRows ¶
func (oft *OutputFormatterTable) AppendRows(rows [][]interface{})
func (*OutputFormatterTable) SetColumnWidthMax ¶
func (oft *OutputFormatterTable) SetColumnWidthMax(widthMax []int)
func (*OutputFormatterTable) SetHeader ¶
func (oft *OutputFormatterTable) SetHeader(header []string)
func (*OutputFormatterTable) ToObject ¶
func (oft *OutputFormatterTable) ToObject() OutputFormatterTableObject
Click to show internal directories.
Click to hide internal directories.