Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONRenderer ¶
type JSONRenderer struct { Type RendererType Columns []string // contains filtered or unexported fields }
JSONRenderer is the Renderer used to output JSON.
func NewJSONRenderer ¶
func NewJSONRenderer(opts *JSONRendererOptions) JSONRenderer
NewJSONRenderer creates an instance of JSONRenderer.
func (JSONRenderer) AddSeparator ¶
func (j JSONRenderer) AddSeparator()
AddSeparator not used on JSONRenderer.
func (JSONRenderer) AppendRow ¶
func (j JSONRenderer) AppendRow(row *types.Row)
AppendRow adds a new row to the list.
func (JSONRenderer) Render ¶
func (j JSONRenderer) Render() error
Render returns a JSON representation of the list content.
type JSONRendererOptions ¶
JSONRendererOptions contains options to render JSON content.
type RendererType ¶
type RendererType string
RendererType represents all the existing renderers.
var ( Markdown RendererType = "markdown" Table RendererType = "table" Raw RendererType = "raw" JSON RendererType = "json" )
type TableRenderer ¶
type TableRenderer struct { Type RendererType Columns []string // contains filtered or unexported fields }
TableRenderer is the Renderer used to output tables.
func NewMarkdownRenderer ¶
func NewMarkdownRenderer(opts *TableRendererOptions) TableRenderer
NewMarkdownRenderer creates an instance of TableRenderer.
func NewRawRenderer ¶
func NewRawRenderer(opts *TableRendererOptions) TableRenderer
NewRawRenderer creates an instance of TableRenderer without borders.
func NewTableRenderer ¶
func NewTableRenderer(opts *TableRendererOptions) TableRenderer
NewTableRenderer creates an instance of TableRenderer.
func (TableRenderer) AddSeparator ¶
func (t TableRenderer) AddSeparator()
AddSeparator adds a separator line to the list.
func (TableRenderer) AppendRow ¶
func (t TableRenderer) AppendRow(row *types.Row)
AppendRow adds a new row to the list.
func (TableRenderer) Render ¶
func (t TableRenderer) Render() error
Render prints a table representation of row content.
type TableRendererOptions ¶
TableRendererOptions contains options to render a table.