Package config provides utility objects for decoupling sources of configuration and the
actual configuration state. Consumers must implement the Merger interface to unify
the sources of change into an object.
type Accessor interface {
// MergedState returns a representation of the current merge state.// Must be reentrant when more than one source is defined.
MergedState() interface{}
}
Accessor is an interface for retrieving the current merge state.
type Merger interface {
// Invoked when a change from a source is received. May also function as an incremental// merger if you wish to consume changes incrementally. Must be reentrant when more than// one source is defined.
Merge(source string, update interface{}) error
}
Channel returns a channel where a configuration source
can send updates of new configurations. Multiple calls with the same
source will return the same channel. This allows change and state based sources
to use the same channel. Different source names however will be treated as a
union.