Versions in this module Expand all Collapse all v0 v0.3.1 Jun 21, 2021 Changes in this version + var ErrInvalidKey = errors.New("invalid key, maybe not exist in config") + func Apply(conf map[string]interface{}) error + func Debug(sep string) + func Get(key string) interface + func GetBool(key string) bool + func GetDuration(key string) time.Duration + func GetFloat64(key string) float64 + func GetInt(key string) int + func GetInt64(key string) int64 + func GetSlice(key string) []interface + func GetString(key string) string + func GetStringMap(key string) map[string]interface + func GetStringMapString(key string) map[string]string + func GetStringMapStringSlice(key string) map[string][]string + func GetStringSlice(key string) []string + func GetTime(key string) time.Time + func LoadFromDataSource(ds DataSource, unmarshaller Unmarshaller) error + func LoadFromReader(r io.Reader, unmarshaller Unmarshaller) error + func OnChange(fn func(*Configuration)) + func Reset() + func Set(key string, val interface{}) + func Traverse(sep string) map[string]interface + func UnmarshalKey(key string, rawVal interface{}, opts ...GetOption) error + func UnmarshalWithExpect(key string, expect interface{}) interface + type Configuration struct + func New() *Configuration + func (c *Configuration) Get(key string) interface{} + func (c *Configuration) GetBool(key string) bool + func (c *Configuration) GetDuration(key string) time.Duration + func (c *Configuration) GetFloat64(key string) float64 + func (c *Configuration) GetInt(key string) int + func (c *Configuration) GetInt64(key string) int64 + func (c *Configuration) GetSlice(key string) []interface{} + func (c *Configuration) GetSliceStringMap(key string) []map[string]interface{} + func (c *Configuration) GetString(key string) string + func (c *Configuration) GetStringMap(key string) map[string]interface{} + func (c *Configuration) GetStringMapString(key string) map[string]string + func (c *Configuration) GetStringMapStringSlice(key string) map[string][]string + func (c *Configuration) GetStringSlice(key string) []string + func (c *Configuration) GetTime(key string) time.Time + func (c *Configuration) Load(content []byte, unmarshal Unmarshaller) error + func (c *Configuration) LoadFromDataSource(ds DataSource, unmarshaller Unmarshaller) error + func (c *Configuration) LoadFromReader(reader io.Reader, unmarshaller Unmarshaller) error + func (c *Configuration) OnChange(fn func(*Configuration)) + func (c *Configuration) Set(key string, val interface{}) error + func (c *Configuration) SetKeyDelim(delim string) + func (c *Configuration) Sub(key string) *Configuration + func (c *Configuration) UnmarshalKey(key string, rawVal interface{}, opts ...GetOption) error + func (c *Configuration) UnmarshalWithExpect(key string, expect interface{}) interface{} + func (c *Configuration) WriteConfig() error + type DataSource interface + IsConfigChanged func() <-chan struct{} + ReadConfig func() ([]byte, error) + type GetOption func(o *GetOptions) + func TagName(tag string) GetOption + type GetOptions struct + TagName string + type Unmarshaller = func([]byte, interface{}) error