Versions in this module Expand all Collapse all v2 v2.0.0 Dec 4, 2023 Changes in this version + func Close() + func Get(pattern string, def ...interface{}) value.Value + func GetConfigurator() configurator.Configurator + func Has(pattern string) bool + func Load(ctx context.Context, source string, file ...string) ([]*configurator.Configuration, error) + func Match(patterns ...string) configurator.Matcher + func Set(pattern string, value interface{}) error + func SetConfigurator(configurator configurator.Configurator) + func SetDefaultConfigurator() + func SetSource(sources ...configurator.Source) + func Store(ctx context.Context, source string, file string, content interface{}, ...) error + func Watch(cb configurator.WatchCallbackFunc, names ...string) + type Configuration struct + Content []byte + File string + Format string + FullPath string + Name string + Path string + func (c *Configuration) Decode() (interface{}, error) + func (c *Configuration) Scan(dest interface{}) error + type Configurator interface + Close func() + Get func(pattern string, def ...interface{}) value.Value + Has func(pattern string) bool + Load func(ctx context.Context, source string, file ...string) ([]*Configuration, error) + Match func(patterns ...string) Matcher + Set func(pattern string, value interface{}) error + Store func(ctx context.Context, source string, file string, content interface{}, ...) error + Watch func(cb WatchCallbackFunc, names ...string) + func NewConfigurator(opts ...Option) Configurator + type Decoder func(format string, content []byte) (interface{}, error) + type Encoder func(format string, content interface{}) ([]byte, error) + type Matcher interface + Get func(def ...interface{}) value.Value + Has func() bool + Scan func(dest interface{}) error + type Mode string + const ReadOnly + const ReadWrite + const WriteOnly + type Option func(o *options) + func WithContext(ctx context.Context) Option + func WithDecoder(decoder Decoder) Option + func WithEncoder(encoder Encoder) Option + func WithSources(sources ...Source) Option + type Scanner func(format string, content []byte, dest interface{}) error + type Source interface + Close func() error + Load func(ctx context.Context, file ...string) ([]*Configuration, error) + Name func() string + Store func(ctx context.Context, file string, content []byte) error + Watch func(ctx context.Context) (Watcher, error) + type WatchCallbackFunc func(names ...string) + type Watcher interface + Next func() ([]*Configuration, error) + Stop func() error