forked from jedib0t/go-pretty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
writer.go
40 lines (36 loc) · 937 Bytes
/
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
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)
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)
SetOutputMirror(mirror io.Writer)
SetStyle(style Style)
SetVAlign(vAlign []text.VAlign)
ShowBorder(show bool)
ShowSeparators(show bool)
Style() *Style
}
// NewWriter initializes and returns a Writer.
func NewWriter() Writer {
return &Table{}
}