File: writer.go

package info (click to toggle)
golang-github-jedib0t-go-pretty 6.5.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,700 kB
  • sloc: makefile: 28; sh: 14
file content (45 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download
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"
)

// 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()
	Length() int
	Render() string
	RenderCSV() string
	RenderHTML() string
	RenderMarkdown() string
	RenderTSV() string
	ResetFooters()
	ResetHeaders()
	ResetRows()
	SetAllowedRowLength(length int)
	SetAutoIndex(autoIndex bool)
	SetCaption(format string, a ...interface{})
	SetColumnConfigs(configs []ColumnConfig)
	SetIndexColumn(colNum int)
	SetOutputMirror(mirror io.Writer)
	SetPageSize(numLines int)
	SetRowPainter(painter RowPainter)
	SetStyle(style Style)
	SetTitle(format string, a ...interface{})
	SortBy(sortBy []SortBy)
	Style() *Style
	SuppressEmptyColumns()
	SuppressTrailingSpaces()

	// deprecated; in favor of Style().HTML.CSSClass
	SetHTMLCSSClass(cssClass string)
}

// NewWriter initializes and returns a Writer.
func NewWriter() Writer {
	return &Table{}
}