Documentation ¶
Index ¶
- type AlignType
- type TableWriter
- func (t *TableWriter) PrintFooter()
- func (t *TableWriter) PrintHeader()
- func (t *TableWriter) PrintRow(row []string, alignmentType AlignType) error
- func (t *TableWriter) PrintRowAsOneColumn(value string, alignmentType AlignType) error
- func (t *TableWriter) PrintRows(rows [][]string, alignmentType AlignType) error
- func (t *TableWriter) PrintTable(rows [][]string, alignmentType AlignType)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TableWriter ¶
type TableWriter struct { ColumnHeaders []string ColumnWidths []int // contains filtered or unexported fields }
TableWriter will write the given row data in form of a pretty table
func NewTableWriter ¶
func NewTableWriter(columnHeaders []string, columnWidths []int) (*TableWriter, error)
NewTableWriter will initialize the table writer to format data
func NewTableWriterWithWriter ¶
func NewTableWriterWithWriter(writer io.Writer, columnHeaders []string, columnWidths []int) (*TableWriter, error)
NewTableWriterWithWriter will initialize the table writer with given writer to format data
func (*TableWriter) PrintFooter ¶
func (t *TableWriter) PrintFooter()
PrintFooter will print footer to close the table
func (*TableWriter) PrintHeader ¶
func (t *TableWriter) PrintHeader()
PrintHeader will print the header of the table with column headers
func (*TableWriter) PrintRow ¶
func (t *TableWriter) PrintRow(row []string, alignmentType AlignType) error
PrintRow will print data given in form a row in a table
func (*TableWriter) PrintRowAsOneColumn ¶
func (t *TableWriter) PrintRowAsOneColumn(value string, alignmentType AlignType) error
PrintRowAsOneColumn prints given value as single column
func (*TableWriter) PrintRows ¶
func (t *TableWriter) PrintRows(rows [][]string, alignmentType AlignType) error
PrintRows will print given rows only
func (*TableWriter) PrintTable ¶
func (t *TableWriter) PrintTable(rows [][]string, alignmentType AlignType)
PrintTable will print given rows data as table at once
Click to show internal directories.
Click to hide internal directories.