Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorUnchanged = errors.New("data not changed")
Functions ¶
func GetConfigName ¶
Types ¶
type Config ¶
type Config interface { Load() error Source(sources ...Source) error // Deprecated: As of Go v0.5.3, this function simply calls [ScanTo]. Scan(v interface{}) error ScanTo(v interface{}) error Value(key string) Value Watch(key string, o Observer) error Close() error Path() string Get(key string) Config Root() Config }
Config is a config interface.
type Option ¶
type Option func(*options)
Option is config option.
func WithDecoder ¶
WithDecoder with config decoder. DefaultDecoder behavior: If KeyValue.Format is non-empty, then KeyValue.Value will be deserialized into map[string]interface{} and stored in the config cache(map[string]interface{}) if KeyValue.Format is empty,{KeyValue.Key : KeyValue.Value} will be stored in config cache(map[string]interface{})
type Reader ¶
type Reader interface { Merge(...*KeyValue) error Value(string) (Value, bool) Source() ([]byte, error) Resolve() error }
Reader is config reader.
type Source ¶
type Source interface { Name() string Load() ([]*KeyValue, error) Watch() (Watcher, error) Path() string }
Source is config source.
type Value ¶
type Value interface { Bool() (bool, error) Int() (int64, error) Float() (float64, error) String() string Duration() (time.Duration, error) Slice() ([]Value, error) Map() (map[string]Value, error) Scan(interface{}) error Load() interface{} Store(interface{}) Exists() bool }
Value is config value interface.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.