-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprinteroptions.go
More file actions
87 lines (59 loc) · 1.84 KB
/
printeroptions.go
File metadata and controls
87 lines (59 loc) · 1.84 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package frog
type PrinterOption interface {
isPrinterOption()
String() string
}
// Palette
func POPalette(p Palette) PrinterOption {
return poPalette{ANSIColors: p.toANSI()}
}
type poPalette struct {
ANSIColors ansicolors
}
func (poPalette) isPrinterOption() {}
func (poPalette) String() string { return "POPalette" }
// Time
func POTime(visible bool) poTime {
return poTime{Visible: visible}
}
type poTime struct {
Visible bool
}
func (p poTime) isPrinterOption() {}
func (p poTime) String() string { return "POTime" }
// Level
func POLevel(visible bool) poLevel {
return poLevel{Visible: visible}
}
type poLevel struct {
Visible bool
}
func (p poLevel) isPrinterOption() {}
func (p poLevel) String() string { return "POLevel" }
// Field Indent
func POFieldIndent(indent int) poFieldIndent {
return poFieldIndent{Indent: indent}
}
type poFieldIndent struct {
Indent int
}
func (p poFieldIndent) isPrinterOption() {}
func (p poFieldIndent) String() string { return "POFieldIndent" }
// Message Order: MsgLeftFieldsRight and FieldsLeftMsgRight
var POMsgLeftFieldsRight poMsgLeftFieldsRight
type poMsgLeftFieldsRight struct{}
func (p poMsgLeftFieldsRight) isPrinterOption() {}
func (p poMsgLeftFieldsRight) String() string { return "POMsgLeftFieldsRight" }
var POFieldsLeftMsgRight poFieldsLeftMsgRight
type poFieldsLeftMsgRight struct{}
func (p poFieldsLeftMsgRight) isPrinterOption() {}
func (p poFieldsLeftMsgRight) String() string { return "POFieldsLeftMsgRight" }
// Transient Line Length (meant to crop anchored lines so they don't wrap)
func POTransientLineLength(cols int) poTransientLineLength {
return poTransientLineLength{Cols: cols}
}
type poTransientLineLength struct {
Cols int
}
func (p poTransientLineLength) isPrinterOption() {}
func (p poTransientLineLength) String() string { return "POTransientLineLength" }