Documentation
¶
Index ¶
- Variables
- type Config
- func (c *Config) GetBool(key string, fallback bool) bool
- func (c *Config) GetDuration(key string, fallback time.Duration) time.Duration
- func (c *Config) GetFloat64(key string, fallback float64) float64
- func (c *Config) GetInt(key string, fallback int) int
- func (c *Config) GetIntSlice(key string, fallback []int) []int
- func (c *Config) GetString(key string, fallback string) string
- func (c *Config) GetStringMap(key string, fallback map[string]interface{}) map[string]interface{}
- func (c *Config) GetStringMapString(key string, fallback map[string]string) map[string]string
- func (c *Config) GetStringMapStringSlice(key string, fallback map[string][]string) map[string][]string
- func (c *Config) GetStringSlice(key string, fallback []string) []string
- func (c *Config) GetTime(key string, fallback time.Time) time.Time
- func (c *Config) IsSet(key string) bool
- func (c *Config) Load() error
- type Configer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidProvider when provider invalid return ErrInvalidProvider = errors.New("config: invalid config center provider") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Provider string
Addr string
Path string
// contains filtered or unexported fields
}
Config struct
func (*Config) GetDuration ¶
GetDuration returns the value associated with the key as a duration
func (*Config) GetFloat64 ¶
GetFloat64 returns the value associated with the key as a float64
func (*Config) GetIntSlice ¶
GetIntSlice returns the value associated with the key as a slice of int values
func (*Config) GetStringMap ¶
GetStringMap returns the value associated with the key as a map of interfaces
func (*Config) GetStringMapString ¶
GetStringMapString returns the value associated with the key as a map of strings
func (*Config) GetStringMapStringSlice ¶
func (c *Config) GetStringMapStringSlice(key string, fallback map[string][]string) map[string][]string
GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings
func (*Config) GetStringSlice ¶
GetStringSlice returns the value associated with the key as a slice of strings
type Configer ¶
type Configer interface {
GetString(key string, fallback string) string
GetInt(key string, fallback int) int
GetBool(key string, fallback bool) bool
GetIntSlice(key string, fallback []int) []int
GetStringSlice(key string, fallback []string) []string
GetStringMap(key string, fallback map[string]interface{}) map[string]interface{}
GetStringMapString(key string, fallback map[string]string) map[string]string
GetStringMapStringSlice(key string, fallback map[string][]string) map[string][]string
GetTime(key string, fallback time.Time) time.Time
GetDuration(key string, fallback time.Duration) time.Duration
GetFloat64(key string, fallback float64) float64
IsSet(key string) bool
}
Configer interface
Click to show internal directories.
Click to hide internal directories.