-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathwriter.go
49 lines (45 loc) · 1.24 KB
/
writer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package table
import (
"io"
)
// Writer declares the interfaces that can be used to set up and render a table.
type Writer interface {
AppendFooter(row Row, configs ...RowConfig)
AppendHeader(row Row, configs ...RowConfig)
AppendRow(row Row, configs ...RowConfig)
AppendRows(rows []Row, configs ...RowConfig)
AppendSeparator()
ImportGrid(grid interface{}) bool
Length() int
Pager(opts ...PagerOption) Pager
Render() string
RenderCSV() string
RenderHTML() string
RenderMarkdown() string
RenderTSV() string
ResetFooters()
ResetHeaders()
ResetRows()
SetAutoIndex(autoIndex bool)
SetCaption(format string, a ...interface{})
SetColumnConfigs(configs []ColumnConfig)
SetIndexColumn(colNum int)
SetOutputMirror(mirror io.Writer)
SetRowPainter(painter interface{})
SetStyle(style Style)
SetTitle(format string, a ...interface{})
SortBy(sortBy []SortBy)
Style() *Style
SuppressEmptyColumns()
SuppressTrailingSpaces()
// deprecated; in favor if Style().Size.WidthMax
SetAllowedRowLength(length int)
// deprecated; in favor of Style().HTML.CSSClass
SetHTMLCSSClass(cssClass string)
// deprecated; in favor of Pager()
SetPageSize(numLines int)
}
// NewWriter initializes and returns a Writer.
func NewWriter() Writer {
return &Table{}
}