Documentation ¶
Index ¶
- func Get(key string, opts ...Option) (res interface{}, ok bool)
- func GetBool(key string, opts ...Option) (v bool, ok bool)
- func GetDuration(key string, opts ...Option) (v time.Duration, ok bool)
- func GetFloat(key string, opts ...Option) (v float64, ok bool)
- func GetInt(key string, opts ...Option) (v int64, ok bool)
- func GetString(key string, opts ...Option) (v string, ok bool)
- func GetTime(key string, opts ...Option) (v time.Time, ok bool)
- func Init()
- func WatchConfig(f func(conf *Config), opts ...Option)
- type Config
- func (c *Config) Get(key string) (v interface{}, ok bool)
- func (c *Config) GetBool(key string) (v bool, ok bool)
- func (c *Config) GetDuration(key string) (v time.Duration, ok bool)
- func (c *Config) GetFloat(key string) (v float64, ok bool)
- func (c *Config) GetInt(key string) (v int64, ok bool)
- func (c *Config) GetString(key string) (v string, ok bool)
- func (c *Config) GetTime(key string) (v time.Time, ok bool)
- func (c *Config) Raw() []byte
- func (c *Config) Unmarshal(v interface{}) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WatchConfig ¶
WatchConfig 订阅配置文件的变化,如果非空则第一次必推送 可能推送nil config
Types ¶
Click to show internal directories.
Click to hide internal directories.