Documentation
¶
Index ¶
- type Config
- type MemConfig
- func (this *MemConfig) Get(key string) interface{}
- func (this *MemConfig) GetBool(key string) bool
- func (this *MemConfig) GetDuration(key string) time.Duration
- func (this *MemConfig) GetFloat64(key string) float64
- func (this *MemConfig) GetInt(key string) int
- func (this *MemConfig) GetInt32(key string) int32
- func (this *MemConfig) GetInt64(key string) int64
- func (this *MemConfig) GetSizeInBytes(key string) uint
- func (this *MemConfig) GetString(key string) string
- func (this *MemConfig) GetStringMap(key string) map[string]interface{}
- func (this *MemConfig) GetStringMapString(key string) map[string]string
- func (this *MemConfig) GetStringMapStringSlice(key string) map[string][]string
- func (this *MemConfig) GetStringSlice(key string) []string
- func (this *MemConfig) GetTime(key string) time.Time
- func (this *MemConfig) GetUint(key string) uint
- func (this *MemConfig) GetUint32(key string) uint32
- func (this *MemConfig) GetUint64(key string) uint64
- func (this *MemConfig) Set(key string, value interface{})
- func (this *MemConfig) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func (this *MemConfig) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- type NullConfig
- func (this *NullConfig) Get(key string) interface{}
- func (this *NullConfig) GetBool(key string) bool
- func (this *NullConfig) GetDuration(key string) time.Duration
- func (this *NullConfig) GetFloat64(key string) float64
- func (this *NullConfig) GetInt(key string) int
- func (this *NullConfig) GetInt32(key string) int32
- func (this *NullConfig) GetInt64(key string) int64
- func (this *NullConfig) GetSizeInBytes(key string) uint
- func (this *NullConfig) GetString(key string) string
- func (this *NullConfig) GetStringMap(key string) map[string]interface{}
- func (this *NullConfig) GetStringMapString(key string) map[string]string
- func (this *NullConfig) GetStringMapStringSlice(key string) map[string][]string
- func (this *NullConfig) GetStringSlice(key string) []string
- func (this *NullConfig) GetTime(key string) time.Time
- func (this *NullConfig) GetUint(key string) uint
- func (this *NullConfig) GetUint32(key string) uint32
- func (this *NullConfig) GetUint64(key string) uint64
- func (this *NullConfig) Set(key string, value interface{})
- func (this *NullConfig) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func (this *NullConfig) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- type Option
- type ViperConfOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type 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
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 NewViperConfig ¶
type MemConfig ¶
type MemConfig struct {
// contains filtered or unexported fields
}
func NewMemConfig ¶
func NewMemConfig() *MemConfig
func (*MemConfig) GetFloat64 ¶
func (*MemConfig) GetStringMap ¶
func (*MemConfig) GetStringMapString ¶
func (*MemConfig) GetStringMapStringSlice ¶
func (*MemConfig) GetStringSlice ¶
func (*MemConfig) Unmarshal ¶
func (this *MemConfig) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
func (*MemConfig) UnmarshalKey ¶
func (this *MemConfig) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
type NullConfig ¶
type NullConfig struct {
// contains filtered or unexported fields
}
func NewNullConfig ¶
func NewNullConfig() *NullConfig
func (*NullConfig) Get ¶
func (this *NullConfig) Get(key string) interface{}
func (*NullConfig) GetBool ¶
func (this *NullConfig) GetBool(key string) bool
func (*NullConfig) GetDuration ¶
func (this *NullConfig) GetDuration(key string) time.Duration
func (*NullConfig) GetFloat64 ¶
func (this *NullConfig) GetFloat64(key string) float64
func (*NullConfig) GetInt ¶
func (this *NullConfig) GetInt(key string) int
func (*NullConfig) GetInt32 ¶
func (this *NullConfig) GetInt32(key string) int32
func (*NullConfig) GetInt64 ¶
func (this *NullConfig) GetInt64(key string) int64
func (*NullConfig) GetSizeInBytes ¶
func (this *NullConfig) GetSizeInBytes(key string) uint
TODO 还没实现
func (*NullConfig) GetString ¶
func (this *NullConfig) GetString(key string) string
func (*NullConfig) GetStringMap ¶
func (this *NullConfig) GetStringMap(key string) map[string]interface{}
func (*NullConfig) GetStringMapString ¶
func (this *NullConfig) GetStringMapString(key string) map[string]string
func (*NullConfig) GetStringMapStringSlice ¶
func (this *NullConfig) GetStringMapStringSlice(key string) map[string][]string
func (*NullConfig) GetStringSlice ¶
func (this *NullConfig) GetStringSlice(key string) []string
func (*NullConfig) GetUint ¶
func (this *NullConfig) GetUint(key string) uint
func (*NullConfig) GetUint32 ¶
func (this *NullConfig) GetUint32(key string) uint32
func (*NullConfig) GetUint64 ¶
func (this *NullConfig) GetUint64(key string) uint64
func (*NullConfig) Set ¶
func (this *NullConfig) Set(key string, value interface{})
func (*NullConfig) Unmarshal ¶
func (this *NullConfig) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
func (*NullConfig) UnmarshalKey ¶
func (this *NullConfig) UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
type ViperConfOptions ¶
type ViperConfOptions struct{}
func (ViperConfOptions) WithConfFile ¶
func (ViperConfOptions) WithConfFile(configFile []string) Option
func (ViperConfOptions) WithConfigType ¶
func (ViperConfOptions) WithConfigType(configType string) Option
Click to show internal directories.
Click to hide internal directories.