Documentation
¶
Index ¶
Constants ¶
View Source
const ( AlignLeft = 0 AlignMiddle = 1 AlignRight = 2 )
View Source
const (
DefaultIndent = 4
)
Variables ¶
View Source
var ( BorderFull = string(runesBorderFull) BorderCompact = string(runesBorderCompact) )
Functions ¶
func PaddingBuffer ¶
func PaddingString ¶
Types ¶
type Column ¶
type Column struct {
Title string // title to be displayed
Field string // field name for retrieving data
Width int // column width, >0 fixed, =0 auto, <0 percentage
MaxWidth int // maximum column width
Align int
Fetcher func(column Column, row map[string]interface{}) interface{}
Formatter FormatterFunc
Styler StylerFunc
}
type FormatterFunc ¶
type FormatterFunc func(class string, data interface{}, formatter FormatterFunc) string
type KeyRankFunc ¶
func ArrayKeyRanker ¶
func ArrayKeyRanker(keys []string) KeyRankFunc
func PatternArrayKeyRanker ¶
func PatternArrayKeyRanker(dict map[string][]string) KeyRankFunc
func SuffixArrayKeyRanker ¶
func SuffixArrayKeyRanker(dict map[string][]string) KeyRankFunc
type Output ¶
type Output struct {
Padding int
Writer io.Writer
Styler StylerFunc
Formatter FormatterFunc
}
func (*Output) PaddingBuffer ¶
func (*Output) PaddingString ¶
type StylerFunc ¶
type Table ¶
type Table struct {
Output
Border string // border characters
// top: LT T TS RT
// row: L S R
// bot: LB B BS RB
// row-splitter: LS C CS RS
// head: LH SH RH
// head-splitter: LSH CH CSH RSH
Columns []Column // Column definitions
MaxWidth int // maximum table width
// contains filtered or unexported fields
}
func (*Table) HideColumns ¶
Click to show internal directories.
Click to hide internal directories.
