-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.go
48 lines (40 loc) · 869 Bytes
/
io.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
package app
import (
"io"
"github.com/goatcms/goatcore/filesystem"
)
// Input represent a standard input
type Input interface {
io.Reader
ReadWord() (string, error)
ReadLine() (string, error)
}
// Output represent a standard output
type Output interface {
io.Writer
Printf(format string, a ...interface{}) error
}
// IO represent a standard input/output
type IO interface {
In() Input
Out() Output
Err() Output
CWD() filesystem.Filespace
}
// IOContext represent application execution context
type IOContext interface {
IO() IO
Scope() Scope
Close() (err error)
}
// Broadcast buffer and write data to each added writer data
type Broadcast interface {
Output
Add(writer io.Writer) (err error)
}
// BufferedBroadcast buffer and write data to each added writer data
type BufferedBroadcast interface {
Broadcast
String() string
Bytes() []byte
}