Documentation ¶
Index ¶
- func Exists(key string) bool
- func Flush() error
- func Get(key string) interface{}
- func GetInt(key string) int
- func GetInt64(key string) int64
- func GetString(key string) string
- func GetStringMap(key string) map[string]interface{}
- func Load(filepath string) error
- func OnChange(fn func(*Configuration))
- func OnLoaded(fn func(*Configuration))
- func Reset()
- func Set(key string, val interface{})
- type Configuration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(key string) interface{}
Get returns an interface. For a specific value use one of the Get____ methods.
func GetInt ¶
GetInt returns the value associated with the key as an integer with default defaultConfiguration.
func GetInt64 ¶ added in v0.1.4
GetInt returns the value associated with the key as an integer with default defaultConfiguration.
func GetString ¶
GetString returns the value associated with the key as a string with default defaultConfiguration.
func GetStringMap ¶
GetStringMap returns the value associated with the key as a map of interfaces with default defaultConfiguration.
func Load ¶
LoadFromDataSource load configuration from data source if data source supports dynamic config, a monitor goroutinue would be
func OnLoaded ¶
func OnLoaded(fn func(*Configuration))
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
func (*Configuration) Load ¶
func (c *Configuration) Load(filepath string) error
func (*Configuration) OnChange ¶
func (c *Configuration) OnChange(fn func(*Configuration))
OnChange 注册change回调函数 TODO: 未实现
func (*Configuration) OnLoaded ¶
func (c *Configuration) OnLoaded(fn func(*Configuration))
Click to show internal directories.
Click to hide internal directories.