Documentation ¶
Index ¶
- func CustomTable(data [][]string, header bool, delimiter, frame string) string
- func Table(data [][]string, header bool) string
- type OrderedTable
- func (t *OrderedTable) AddColumn(column []string)
- func (t *OrderedTable) AddRow(row []string)
- func (t *OrderedTable) CustomString(delimiter, frame string) string
- func (t *OrderedTable) CustomStringWithOrder(order []string, delimiter, frame string) string
- func (t *OrderedTable) Matrix() [][]string
- func (t *OrderedTable) MatrixWithOrder(order []string) [][]string
- func (t *OrderedTable) String() string
- func (t *OrderedTable) StringWithOrder(order []string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomTable ¶
Given the data in the format [row][column] return a string with a grid using specified delimter and frame characters.
Types ¶
type OrderedTable ¶
type OrderedTable struct {
// contains filtered or unexported fields
}
func NewOrderedTable ¶
func NewOrderedTable() OrderedTable
func NewOrderedTableFromMatrix ¶
func NewOrderedTableFromMatrix(data [][]string) OrderedTable
Create a new ordered table given a two dimensional slice.
func (*OrderedTable) AddColumn ¶
func (t *OrderedTable) AddColumn(column []string)
Add a new column to the table object, expects the first item in the slice to be the header name.
func (*OrderedTable) AddRow ¶
func (t *OrderedTable) AddRow(row []string)
Add a row to the table object
func (*OrderedTable) CustomString ¶
func (t *OrderedTable) CustomString(delimiter, frame string) string
Return the table as a string using a provided delimiter and frame character.
func (*OrderedTable) CustomStringWithOrder ¶
func (t *OrderedTable) CustomStringWithOrder(order []string, delimiter, frame string) string
Return the table as a string using the provided delimiter and frame characters in the specified order.
func (*OrderedTable) Matrix ¶
func (t *OrderedTable) Matrix() [][]string
Return the ordered table as a two dimensional slice [][]string
func (*OrderedTable) MatrixWithOrder ¶
func (t *OrderedTable) MatrixWithOrder(order []string) [][]string
Return the ordered table as a two dimensional slice [][]string given a specified order
func (*OrderedTable) String ¶
func (t *OrderedTable) String() string
Return the table as a pretty string
func (*OrderedTable) StringWithOrder ¶
func (t *OrderedTable) StringWithOrder(order []string) string
Return the table as a string with the given order