-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
41 lines (33 loc) · 1.02 KB
/
types.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
// Copyright © 2016 Pennock Tech, LLC.
// All rights reserved, except as granted under license.
// Licensed per file LICENSE.txt
package tabular // import "go.pennock.tech/tabular"
// Open questions:
// * should we use interfaces to handle reflow and default to reflow
// Stringer to match fmt's.
// Embedded newlines will be handled to provide lines.
type Stringer interface {
String() string
}
// GoStringer to match fmt's.
type GoStringer interface {
GoString() string
}
// Fielder for ability to grab "a row" from a type.
type Fielder interface {
Fields() []string
}
// AnonFielder to avoid caller having to iterate an []interface{}
// to construct strings; we then just do cell breakdown on each.
type AnonFielder interface {
AnonFields() []interface{}
}
// TerminalCellWidther should be implemented to override tabular's conception
// of how "wide" a cell's contents are.
type TerminalCellWidther interface {
TerminalCellWidth() int
}
// Heighter lets an object override how tall it is.
type Heighter interface {
Height() int
}