-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
133 lines (89 loc) · 2.49 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package config
import (
"time"
"github.com/spf13/viper"
)
var _conf Config
type Config interface {
Get(key string) interface{}
GetString(key string) string
GetBool(key string) bool
GetInt(key string) int
GetInt32(key string) int32
GetInt64(key string) int64
GetUint(key string) uint
GetUint32(key string) uint32
GetUint64(key string) uint64
GetFloat64(key string) float64
GetTime(key string) time.Time
GetDuration(key string) time.Duration
// GetIntSlice(key string) []int { return viper.GetIntSlice(key) }
GetStringSlice(key string) []string
GetStringMap(key string) map[string]interface{}
GetStringMapString(key string) map[string]string
GetStringMapStringSlice(key string) map[string][]string
GetSizeInBytes(key string) uint
UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
Set(key string, value interface{})
}
func Get(key string) interface{} {
return _conf.Get(key)
}
func GetString(key string) string {
return _conf.GetString(key)
}
func GetBool(key string) bool {
return _conf.GetBool(key)
}
func GetInt(key string) int {
return _conf.GetInt(key)
}
func GetInt32(key string) int32 {
return _conf.GetInt32(key)
}
func GetInt64(key string) int64 {
return _conf.GetInt64(key)
}
func GetUint(key string) uint {
return _conf.GetUint(key)
}
func GetUint32(key string) uint32 {
return _conf.GetUint32(key)
}
func GetUint64(key string) uint64 {
return _conf.GetUint64(key)
}
func GetFloat64(key string) float64 {
return _conf.GetFloat64(key)
}
func GetTime(key string) time.Time {
return _conf.GetTime(key)
}
func GetDuration(key string) time.Duration {
return _conf.GetDuration(key)
}
func GetStringSlice(key string) []string {
return _conf.GetStringSlice(key)
}
func GetStringMap(key string) map[string]interface{} {
return _conf.GetStringMap(key)
}
func GetStringMapString(key string) map[string]string {
return _conf.GetStringMapString(key)
}
func GetStringMapStringSlice(key string) map[string][]string {
return _conf.GetStringMapStringSlice(key)
}
func GetSizeInBytes(key string) uint {
return _conf.GetSizeInBytes(key)
}
func UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error {
return _conf.UnmarshalKey(key, rawVal, opts...)
}
func Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error {
return _conf.Unmarshal(rawVal, opts...)
}
func Set(key string, value interface{}) {
_conf.Set(key, value)
}