forked from jedib0t/go-pretty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
writer.go
45 lines (41 loc) · 1.09 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
package table
import (
"io"
"github.com/jedib0t/go-pretty/text"
)
// Writer declares the interfaces that can be used to setup and render a table.
type Writer interface {
AppendFooter(row Row)
AppendHeader(row Row)
AppendRow(row Row)
AppendRows(rows []Row)
Length() int
Render() string
RenderCSV() string
RenderHTML() string
RenderMarkdown() string
SetAlign(align []text.Align)
SetAlignFooter(align []text.Align)
SetAlignHeader(align []text.Align)
SetAllowedColumnLengths(lengths []int)
SetAllowedRowLength(length int)
SetAutoIndex(autoIndex bool)
SetCaption(format string, a ...interface{})
SetColors(colors []text.Colors)
SetColorsFooter(colors []text.Colors)
SetColorsHeader(colors []text.Colors)
SetHTMLCSSClass(cssClass string)
SetIndexColumn(colNum int)
SetOutputMirror(mirror io.Writer)
SetPageSize(numLines int)
SetStyle(style Style)
SetVAlign(vAlign []text.VAlign)
SetVAlignFooter(vAlign []text.VAlign)
SetVAlignHeader(vAlign []text.VAlign)
SortBy(sortBy []SortBy)
Style() *Style
}
// NewWriter initializes and returns a Writer.
func NewWriter() Writer {
return &Table{}
}