Versions in this module Expand all Collapse all v0 v0.3.5 Feb 20, 2020 Changes in this version + var ErrDifferentTypes = errors.New("paladin: value different types") + var ErrNotExist = errors.New("paladin: value key not exist") + var ErrTypeAssertion = errors.New("paladin: value type assertion no match") + func Bool(v *Value, def bool) bool + func Close() error + func Drivers() []string + func Duration(v *Value, def time.Duration) time.Duration + func Float32(v *Value, def float32) float32 + func Float64(v *Value, def float64) float64 + func Init(args ...interface{}) (err error) + func Int(v *Value, def int) int + func Int32(v *Value, def int32) int32 + func Int64(v *Value, def int64) int64 + func KeyNamed(key string) string + func Keys() []string + func Register(name string, driver Driver) + func String(v *Value, def string) string + func Watch(key string, s Setter) error + func WatchEvent(ctx context.Context, keys ...string) <-chan Event + type Client interface + var DefaultClient Client + func NewFile(base string) (Client, error) + func NewMock(vs map[string]string) Client + type Driver interface + New func() (Client, error) + func GetDriver(name string) (Driver, error) + type Event struct + Event EventType + Key string + Value string + type EventType int + const EventAdd + const EventRemove + const EventUpdate + type Getter interface + Get func(string) *Value + GetAll func() *Map + type Map struct + func GetAll() *Map + func (m *Map) Exist(key string) bool + func (m *Map) Get(key string) *Value + func (m *Map) Keys() []string + func (m *Map) Load() map[string]*Value + func (m *Map) Store(values map[string]*Value) + type Mock struct + C chan Event + func (m *Mock) Close() error + func (m *Mock) GetAll() *Map + func (m *Mock) WatchEvent(ctx context.Context, key ...string) <-chan Event + type Setter interface + Set func(string) error + type TOML = Map + func (m *TOML) Set(text string) error + func (m *TOML) UnmarshalText(text []byte) error + type Value struct + func Get(key string) *Value + func NewValue(val interface{}, raw string) *Value + func (v *Value) Bool() (bool, error) + func (v *Value) Duration() (time.Duration, error) + func (v *Value) Float32() (float32, error) + func (v *Value) Float64() (float64, error) + func (v *Value) Int() (int, error) + func (v *Value) Int32() (int32, error) + func (v *Value) Int64() (int64, error) + func (v *Value) Raw() (string, error) + func (v *Value) Slice(dst interface{}) error + func (v *Value) String() (string, error) + func (v *Value) Unmarshal(un encoding.TextUnmarshaler) error + func (v *Value) UnmarshalJSON(dst interface{}) error + func (v *Value) UnmarshalTOML(dst interface{}) error + func (v *Value) UnmarshalYAML(dst interface{}) error + type Watcher interface + Close func() error + WatchEvent func(context.Context, ...string) <-chan Event