-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinterfaces.go
More file actions
36 lines (30 loc) · 834 Bytes
/
interfaces.go
File metadata and controls
36 lines (30 loc) · 834 Bytes
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
package go_config
type Config interface {
Fields
UseSource(sources ...Source)
SetDefault(key string, val interface{})
}
type Fields interface {
Bool(key string) bool
Get(key string) interface{}
Float(key string) float64
Int(key string) int
IsSet(key string) bool
Slice(key, delimiter string) []interface{}
String(key string) string
StringMap(key string) map[string]interface{}
Sub(key string) Fields
UInt(key string) uint
Unmarshal(v interface{}, prefix string) error
}
type Source interface {
Get(key string) interface{}
Bool(key string) (bool, error)
Float(key string) (float64, error)
Int(key string) (int, error)
UInt(key string) (uint, error)
Slice(key, delimiter string) ([]interface{}, error)
String(key string) (string, error)
StringMap(key string) map[string]interface{}
IsSet(key string) bool
}