Documentation
¶
Index ¶
Constants ¶
View Source
const ( FormatTable = "table" FormatJSON = "json" FormatPretty = "pretty" )
Format types
View Source
const SensitiveOverlay = "********"
SensitiveOverlay is the string used to hide sensitive information
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter interface {
// Format formats the data and writes it to the writer
Format(data interface{}) error
}
Formatter is the interface for output formatting
type JSONFormatter ¶
type JSONFormatter struct {
// contains filtered or unexported fields
}
JSONFormatter formats output as compact JSON
func NewJSONFormatter ¶
func NewJSONFormatter(opts Options) *JSONFormatter
NewJSONFormatter creates a new JSON formatter
func (*JSONFormatter) Format ¶
func (f *JSONFormatter) Format(data interface{}) error
Format formats the data as compact JSON
type PrettyFormatter ¶
type PrettyFormatter struct {
// contains filtered or unexported fields
}
PrettyFormatter formats output as indented JSON
func NewPrettyFormatter ¶
func NewPrettyFormatter(opts Options) *PrettyFormatter
NewPrettyFormatter creates a new pretty JSON formatter
func (*PrettyFormatter) Format ¶
func (f *PrettyFormatter) Format(data interface{}) error
Format formats the data as indented JSON
type TableFormatter ¶
type TableFormatter struct {
// contains filtered or unexported fields
}
TableFormatter formats output as a table
func NewTableFormatter ¶
func NewTableFormatter(opts Options) *TableFormatter
NewTableFormatter creates a new table formatter
func (*TableFormatter) Format ¶
func (f *TableFormatter) Format(data any) (err error)
Click to show internal directories.
Click to hide internal directories.