-
Notifications
You must be signed in to change notification settings - Fork 3
/
interface.go
67 lines (47 loc) · 1.57 KB
/
interface.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package line
// compile time check of Interface conformance
var (
_ Interface = &Line{}
_ Interface = &Output{}
)
// Interface is Line's interface
type Interface interface {
// Prefix sets the prefix for the returned Output
Prefix(prefix string) *Output
// Suffix sets the suffix for the returned Output
Suffix(suffix string) *Output
// Format sets the Format for the returned Output
Format(f Formatter) *Output
// Print prints and returns an Output allowing for chaining
Print(a ...interface{}) *Output
// Println prints the arguments with a new line
Println(a ...interface{}) *Output
// Printf prints and returns an Output allowing for chaining
Printf(format string, a ...interface{}) *Output
// Info prints using formatting suitable for an info message
Info(a ...interface{}) *Output
// Progress prints with an "-->" prefix
Progress(a ...interface{}) *Output
// Error prints using formatting suitable for an error message
Error(a ...interface{}) *Output
// Black prints black text
Black(a ...interface{}) *Output
// Red prints red text
Red(a ...interface{}) *Output
// Green prints green text
Green(a ...interface{}) *Output
// Yellow prints yellow text
Yellow(a ...interface{}) *Output
// Blue prints blue text
Blue(a ...interface{}) *Output
// Magenta prints magenta text
Magenta(a ...interface{}) *Output
// Cyan prints cyan text
Cyan(a ...interface{}) *Output
// White prints white text
White(a ...interface{}) *Output
}
// Formatter formats arguments to be suitable for printing
type Formatter interface {
Sprint(a ...interface{}) string
}