Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedFormat = fmt.Errorf("unsupported output format")
)
Functions ¶
func PrintData ¶
func PrintData(w io.Writer, data TabularData, format Format) error
PrintData is the main function to print data in the specified format.
func SupportedOutputFormats ¶
func SupportedOutputFormats() []string
SupportedOutputFormats returns the list of supported output formats, for use in help text.
Types ¶
type Format ¶
type Format string
Format represents the output format.
func DefaultOutputFormat ¶
func DefaultOutputFormat() Format
DefaultOutputFormat returns the suggested output format
type TabularData ¶
type TabularData struct { Headers []string // Column headers Rows [][]interface{} // Rows of data }
TabularData represents the data to be printed in a structured format.
func FilterColumns ¶
func FilterColumns(data TabularData, columns []string) TabularData
FilterColumns will filter out all columns not in the provided list.
Click to show internal directories.
Click to hide internal directories.