-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
46 lines (36 loc) · 856 Bytes
/
config.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
package config
import "time"
const (
TomlType = Type("Toml")
TomlJson = Type("Json")
Delimiter = "."
)
type Type string
type Node interface {
Type() Type
Value() interface{}
Access(string) Node
AccessArray(string) []Node
AccessMap(string) map[string]Node
String() string
}
type Value interface {
Node
Has(string) bool
HasArray(string) bool
HasMap(string) bool
Bool(key string, def bool) bool
Str(key string, def string) string
Int(key string, def int) int
Int64(key string, def int64) int64
Float64(key string, def float64) float64
Duration(key string, def time.Duration) time.Duration
BoolArray(string) []bool
StrArray(string) []string
IntArray(string) []int
Int64Array(string) []int64
Float64Array(string) []float64
DurationArray(string) []time.Duration
ValueArray(string) []Value
ValueMap(string) map[string]Value
}