tables

package
v0.0.0-...-00cb0e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2017 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomTable

func CustomTable(data [][]string, header bool, delimiter, frame string) string

Given the data in the format [row][column] return a string with a grid using specified delimter and frame characters.

func Table

func Table(data [][]string, header bool) string

Given the data in the format [row][column] return a string with a grid using | for both the delimiter and outer 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL