Documentation ¶
Index ¶
- Constants
- Variables
- func AllowProviderOverride()
- func Env(prefix string)
- func ErrorProvider(name string, err error)
- func File(filename string)
- func FileCustom(filename string, fn func([]byte) ([]Item, error))
- func FileCustomRefresh(filename string, fn func([]byte) ([]Item, error))
- func FileList(dirname string)
- func FileListRefresh(dirname string)
- func FileRefresh(filename string)
- func FileTree(dirname string)
- func FileTreeRefresh(dirname string)
- func GetItemValue(key string) (string, error)
- func GetItemValueBool(key string) (bool, error)
- func GetItemValueDuration(key string) (time.Duration, error)
- func GetItemValueFloat(key string) (float64, error)
- func GetItemValueInt(key string) (int64, error)
- func GetItemValueUint(key string) (uint64, error)
- func InitFromEnvironment()
- func NotifyIsMuted() bool
- func NotifyMute()
- func NotifyUnmute()
- func NotifyWatchers()
- func RegisterProvider(name string, f Provider)
- func RegisterProviderFactory(name string, f ProviderFactory)
- func UnregisterProvider(name string)
- func Watch() chan struct{}
- type ErrAmbiguousItem
- type ErrItemNotFound
- type ErrProvider
- type ErrUninitializedItemList
- type InMemoryProvider
- type Item
- func (s *Item) Key() string
- func (s Item) Priority() int64
- func (s *Item) UnmarshalJSON(b []byte) error
- func (s Item) Unmarshaled() (interface{}, error)
- func (s Item) Value() (string, error)
- func (s Item) ValueBool() (bool, error)
- func (s Item) ValueBytes() ([]byte, error)
- func (s Item) ValueDuration() (time.Duration, error)
- func (s Item) ValueFloat() (float64, error)
- func (s Item) ValueInt() (int64, error)
- func (s Item) ValueUint() (uint64, error)
- type ItemFilter
- func (s *ItemFilter) Apply(items *ItemList) *ItemList
- func (s *ItemFilter) GetFirstItem() (Item, error)
- func (s *ItemFilter) GetItem(key string) (Item, error)
- func (s *ItemFilter) GetItemList() (*ItemList, error)
- func (s *ItemFilter) GetItemValue(key string) (string, error)
- func (s *ItemFilter) GetItemValueBool(key string) (bool, error)
- func (s *ItemFilter) GetItemValueDuration(key string) (time.Duration, error)
- func (s *ItemFilter) GetItemValueFloat(key string) (float64, error)
- func (s *ItemFilter) GetItemValueInt(key string) (int64, error)
- func (s *ItemFilter) GetItemValueUint(key string) (uint64, error)
- func (s *ItemFilter) MustGetFirstItem() Item
- func (s *ItemFilter) MustGetItem(key string) Item
- func (s *ItemFilter) Rekey(rekeyF func(*Item) string) *ItemFilter
- func (s *ItemFilter) Reorder(reorderF func(*Item) int64) *ItemFilter
- func (s *ItemFilter) Slice(key string, keyF ...func(string) string) *ItemFilter
- func (s *ItemFilter) Squash() *ItemFilter
- func (s *ItemFilter) Store(st *Store) *ItemFilter
- func (s *ItemFilter) String() string
- func (s *ItemFilter) Transform(transformF func(*Item) (string, error)) *ItemFilter
- func (s *ItemFilter) Unmarshal(f func() interface{}) *ItemFilter
- type ItemList
- func (s *ItemList) GetItem(key string) (Item, error)
- func (s *ItemList) GetItemValue(key string) (string, error)
- func (s *ItemList) GetItemValueBool(key string) (bool, error)
- func (s *ItemList) GetItemValueDuration(key string) (time.Duration, error)
- func (s *ItemList) GetItemValueFloat(key string) (float64, error)
- func (s *ItemList) GetItemValueInt(key string) (int64, error)
- func (s *ItemList) GetItemValueUint(key string) (uint64, error)
- func (s *ItemList) Keys() []string
- func (s *ItemList) Len() int
- func (s *ItemList) Less(i, j int) bool
- func (s *ItemList) Swap(i, j int)
- type Provider
- type ProviderFactory
- type Store
- func (s *Store) AllowProviderOverride()
- func (s *Store) Close() error
- func (s *Store) Env(prefix string)
- func (s *Store) ErrorProvider(name string, err error)
- func (s *Store) File(filename string)
- func (s *Store) FileCustom(filename string, fn func([]byte) ([]Item, error))
- func (s *Store) FileCustomRefresh(filename string, fn func([]byte) ([]Item, error))
- func (s *Store) FileList(dirname string)
- func (s *Store) FileListRefresh(dirname string)
- func (s *Store) FileRefresh(filename string)
- func (s *Store) FileTree(dirname string)
- func (s *Store) FileTreeRefresh(dirname string)
- func (s *Store) GetItem(key string) (Item, error)
- func (s *Store) GetItemList() (*ItemList, error)
- func (s *Store) GetItemValue(key string) (string, error)
- func (s *Store) GetItemValueBool(key string) (bool, error)
- func (s *Store) GetItemValueDuration(key string) (time.Duration, error)
- func (s *Store) GetItemValueFloat(key string) (float64, error)
- func (s *Store) GetItemValueInt(key string) (int64, error)
- func (s *Store) GetItemValueUint(key string) (uint64, error)
- func (s *Store) InMemory(name string) *InMemoryProvider
- func (s *Store) InitFromEnvironment()
- func (s *Store) NotifyIsMuted() bool
- func (s *Store) NotifyMute()
- func (s *Store) NotifyUnmute()
- func (s *Store) NotifyWatchers()
- func (s *Store) RegisterProvider(name string, f Provider)
- func (s *Store) UnregisterProvider(name string)
- func (s *Store) Watch() chan struct{}
Examples ¶
Constants ¶
const (
// ConfigEnvVar defines the environment variable used to set up the configuration providers via InitFromEnvironment
ConfigEnvVar = "CONFIGURATION_FROM"
)
const (
ProviderConflictErrorLabel = "provider-conflict-error"
)
Variables ¶
var (
DefaultStore = NewStore()
)
var LogErrorFunc = log.Printf
Logs functions can be overriden
var LogInfoFunc = log.Printf
Functions ¶
func AllowProviderOverride ¶
func AllowProviderOverride()
AllowProviderOverride allows multiple calls to RegisterProvider() with the same provider name. This is useful for controlled test cases, but is not recommended in the context of a real application.
func Env ¶ added in v0.2.0
func Env(prefix string)
Env registers a provider reading from the environment. Only variables beginning with "PREFIX_" will be considered. Trimmed variable names are used as keys. Keys are not case-sensitive. Underscores (_) in variable names are considered equivalent to dashes (-).
func ErrorProvider ¶
ErrorProvider registers a configstore provider which always returns an error.
func File ¶
func File(filename string)
File registers a configstore provider which reads from the file given in parameter (static content).
func FileCustom ¶
FileCustom registers a configstore provider which reads from the file given in parameter, and loads the content using the given unmarshal function
func FileCustomRefresh ¶
FileCustomRefresh registers a configstore provider which reads from the file given in parameter, and loads the content using the given unmarshal function; and watches file stat for auto refresh
func FileList ¶
func FileList(dirname string)
FileList registers a configstore provider which reads from the files contained in the directory given in parameter. The content of the files should be JSON/YAML similar to the File provider.
func FileListRefresh ¶ added in v0.6.0
func FileListRefresh(dirname string)
FileListRefresh is similar to the FileList provider with the refresh feature enabled. Updates can be handled with the `Watch()` function.
func FileRefresh ¶
func FileRefresh(filename string)
FileRefresh registers a configstore provider which readfs from the file given in parameter (provider watches file stat for auto refresh, watchers get notified).
func FileTree ¶
func FileTree(dirname string)
FileTree registers a configstore provider which reads from the files contained in the directory given in parameter. A limited hierarchy is supported: files can either be top level (in which case the file name will be used as the item key), or nested in a single sub-directory (in which case the sub-directory name will be used as item key for all the files contained in it). The content of the files should be the plain data, with no envelope. Capitalization can be used to indicate item priority for sub-directories containing multiple items which should be differentiated. Capitalized = higher priority.
func FileTreeRefresh ¶ added in v0.6.0
func FileTreeRefresh(dirname string)
FileTreeRefresh is similar to the FileTree provider with the refresh feature enabled. Updates can be handled with the `Watch()` function.
func GetItemValue ¶
GetItemValue fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func GetItemValueBool ¶
GetItemValueBool fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func GetItemValueDuration ¶
GetItemValueDuration fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func GetItemValueFloat ¶
GetItemValueFloat fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func GetItemValueInt ¶
GetItemValueInt fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func GetItemValueUint ¶
GetItemValueUint fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func InitFromEnvironment ¶
func InitFromEnvironment()
InitFromEnvironment initializes configuration providers via their name and an optional argument. Suitable provider factories should have been registered via RegisterProviderFactory for this to work. Built-in providers (File, FileList, FileTree, ...) are registered by default.
Valid example: CONFIGURATION_FROM=file:/etc/myfile.conf,file:/etc/myfile2.conf,filelist:/home/foobar/configs
func NotifyIsMuted ¶ added in v0.1.5
func NotifyIsMuted() bool
NotifyIsMuted reports whether notifications are currently muted.
func NotifyMute ¶ added in v0.1.5
func NotifyMute()
NotifyMute prevents configstore from notifying watchers on configuration changes, until MotifyUnmute() is called.
func NotifyUnmute ¶ added in v0.1.5
func NotifyUnmute()
NotifyUnmute allows configstore to resume notifications to watchers on configuration changes. This will trigger a notification to catch up any change done during the time spent mute.
func NotifyWatchers ¶
func NotifyWatchers()
NotifyWatchers is used by providers to notify of configuration changes. It unblocks all the watchers which are ranging over a watch channel.
func RegisterProvider ¶
RegisterProvider registers a provider
func RegisterProviderFactory ¶
func RegisterProviderFactory(name string, f ProviderFactory)
RegisterProviderFactory registers a factory function so that InitFromEnvironment can properly instantiate configuration providers via name + argument.
func UnregisterProvider ¶ added in v0.5.2
func UnregisterProvider(name string)
UnregisterProvider unregisters a provider
Types ¶
type ErrAmbiguousItem ¶
type ErrAmbiguousItem string
func (ErrAmbiguousItem) Error ¶
func (e ErrAmbiguousItem) Error() string
type ErrItemNotFound ¶
type ErrItemNotFound string
func (ErrItemNotFound) Error ¶
func (e ErrItemNotFound) Error() string
type ErrProvider ¶
type ErrProvider string
func (ErrProvider) Error ¶
func (e ErrProvider) Error() string
type ErrUninitializedItemList ¶
type ErrUninitializedItemList string
func (ErrUninitializedItemList) Error ¶
func (e ErrUninitializedItemList) Error() string
type InMemoryProvider ¶
type InMemoryProvider struct {
// contains filtered or unexported fields
}
InMemoryProvider implements an in-memory configstore provider.
func InMemory ¶
func InMemory(name string) *InMemoryProvider
InMemory registers an InMemoryProvider with a given arbitrary name and returns it. You can append any number of items to it, see Add().
func (*InMemoryProvider) Add ¶
func (inmem *InMemoryProvider) Add(s ...Item) *InMemoryProvider
Add appends an item to the in-memory list.
func (*InMemoryProvider) Items ¶
func (inmem *InMemoryProvider) Items() (ItemList, error)
Items returns the in-memory item list. This is the function that gets called by configstore.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is a key/value pair with a priority attached. The initial priority is set by the provider, but can be modified (see Reorder).
func GetItem ¶
GetItem retrieves the full item list, merging the results from all providers, then returns a single item by key. If 0 or >=2 items are present with that key, it will return an error.
func NewItem ¶
NewItem creates a item object from key / value / priority values. It is meant to be used by provider implementations.
func (*Item) UnmarshalJSON ¶
UnmarshalJSON respects json.Unmarshaler
func (Item) Unmarshaled ¶
Unmarshaled returns the unmarshaled object produced by ItemFilter.Unmarshal, along with any error that was encountered in list processing (unmarshal, transform).
func (Item) Value ¶
Value returns the item value, along with any error that was encountered in list processing (unmarshal, transform).
func (Item) ValueBool ¶
ValueBool returns the item value, along with any error that was encountered in list processing (unmarshal, transform).
func (Item) ValueBytes ¶
ValueBytes returns the item value, along with any error that was encountered in list processing (unmarshal, transform). Data to be returned should be base64 encoded
func (Item) ValueDuration ¶
ValueDuration returns the item value, along with any error that was encountered in list processing (unmarshal, transform).
func (Item) ValueFloat ¶
ValueFloat returns the item value, along with any error that was encountered in list processing (unmarshal, transform).
type ItemFilter ¶
type ItemFilter struct {
// contains filtered or unexported fields
}
ItemFilter holds a list of manipulation steps to operate on an item list. It can be declared globally then used/applied on specific item lists later. By declaring it before actual use, you can make it available to other packages which can then use it to describe your filters / configuration (e.g. main for usage). See String().
func (*ItemFilter) Apply ¶
func (s *ItemFilter) Apply(items *ItemList) *ItemList
Apply applies the filter on an existing item list.
func (*ItemFilter) GetFirstItem ¶
func (s *ItemFilter) GetFirstItem() (Item, error)
GetFirstItem fetches the full item list, applies the filter, then returns the first item of the list.
func (*ItemFilter) GetItem ¶
func (s *ItemFilter) GetItem(key string) (Item, error)
GetItem fetches the full item list, applies the filter, then returns a single item by key.
func (*ItemFilter) GetItemList ¶
func (s *ItemFilter) GetItemList() (*ItemList, error)
GetItemList fetches the full item list, applies the filter, and returns the result.
func (*ItemFilter) GetItemValue ¶
func (s *ItemFilter) GetItemValue(key string) (string, error)
GetItemValue fetches the full item list, applies the filter, then returns a single item's value by key.
func (*ItemFilter) GetItemValueBool ¶
func (s *ItemFilter) GetItemValueBool(key string) (bool, error)
GetItemValueBool fetches the full item list, applies the filter, then returns a single item's value by key.
func (*ItemFilter) GetItemValueDuration ¶
func (s *ItemFilter) GetItemValueDuration(key string) (time.Duration, error)
GetItemValueDuration fetches the full item list, applies the filter, then returns a single item's value by key.
func (*ItemFilter) GetItemValueFloat ¶
func (s *ItemFilter) GetItemValueFloat(key string) (float64, error)
GetItemValueFloat fetches the full item list, applies the filter, then returns a single item's value by key.
func (*ItemFilter) GetItemValueInt ¶
func (s *ItemFilter) GetItemValueInt(key string) (int64, error)
GetItemValueInt fetches the full item list, applies the filter, then returns a single item's value by key.
func (*ItemFilter) GetItemValueUint ¶
func (s *ItemFilter) GetItemValueUint(key string) (uint64, error)
GetItemValueUint fetches the full item list, applies the filter, then returns a single item's value by key.
func (*ItemFilter) MustGetFirstItem ¶
func (s *ItemFilter) MustGetFirstItem() Item
MustGetFirstItem is similar to GetFirstItem, but always returns an Item object. The eventual error is stored inside, and returned when accessing the item's value. Useful for chaining calls.
func (*ItemFilter) MustGetItem ¶
func (s *ItemFilter) MustGetItem(key string) Item
MustGetItem is similar to GetItem, but always returns an Item object. The eventual error is stored inside, and returned when accessing the item's value. Useful for chaining calls.
func (*ItemFilter) Rekey ¶
func (s *ItemFilter) Rekey(rekeyF func(*Item) string) *ItemFilter
Rekey modifies item keys. The function parameter is called for each item in the item list, and the returned string is used as the new key.
func (*ItemFilter) Reorder ¶
func (s *ItemFilter) Reorder(reorderF func(*Item) int64) *ItemFilter
Reorder modifies item priority. The function parameter is called for each item in the item list, and the returned integer is used as the new priority.
func (*ItemFilter) Slice ¶
func (s *ItemFilter) Slice(key string, keyF ...func(string) string) *ItemFilter
Slice filters the list items, keeping only those matching key. You can optionally pass a list of modifier functions, to be invoked when applying the filter.
func (*ItemFilter) Squash ¶
func (s *ItemFilter) Squash() *ItemFilter
Squash filters the items in the item list, keeping only the items with the highest priority for each key.
func (*ItemFilter) Store ¶ added in v0.3.0
func (s *ItemFilter) Store(st *Store) *ItemFilter
Store lets you specify which store instance to use for functions GetItemList, GetItem, ...
func (*ItemFilter) String ¶
func (s *ItemFilter) String() string
String returns a description of the filter.
func (*ItemFilter) Transform ¶
func (s *ItemFilter) Transform(transformF func(*Item) (string, error)) *ItemFilter
Transform modifies item values. The function parameter is called for each item in the item list, and the returned string + error are the values which will be returned by item.Value().
func (*ItemFilter) Unmarshal ¶
func (s *ItemFilter) Unmarshal(f func() interface{}) *ItemFilter
Unmarshal tries to unmarshal (from JSON or YAML) all the items in the item list into objects returned by the factory f(). The results and errors will be stored to be handled later. See item.Unmarshaled().
type ItemList ¶
type ItemList struct { Items []Item // contains filtered or unexported fields }
ItemList is a list of items which can be manipulated by an ItemFilter
func GetItemList ¶
GetItemList retrieves the full item list, merging the results from all providers. It does NOT cache, it's the responsability of the providers to keep an in-ram representation if desired.
func (*ItemList) GetItem ¶
GetItem returns a single item, by key. If 0 or >=2 items are present with that key, it will return an error.
func (*ItemList) GetItemValue ¶
GetItemValue returns a single item value, by key. If 0 or >=2 items are present with that key, it will return an error.
func (*ItemList) GetItemValueBool ¶
GetItemValueBool returns a single item value, by key. If 0 or >=2 items are present with that key, it will return an error.
func (*ItemList) GetItemValueDuration ¶
GetItemValueDuration returns a single item value, by key. If 0 or >=2 items are present with that key, it will return an error.
func (*ItemList) GetItemValueFloat ¶
GetItemValueFloat returns a single item value, by key. If 0 or >=2 items are present with that key, it will return an error.
func (*ItemList) GetItemValueInt ¶
GetItemValueInt returns a single item value, by key. If 0 or >=2 items are present with that key, it will return an error.
func (*ItemList) GetItemValueUint ¶
GetItemValueUint returns a single item value, by key. If 0 or >=2 items are present with that key, it will return an error.
type Provider ¶
A Provider retrieves config items and makes them available to the configstore, Their implementations can vary wildly (HTTP API, file, env, hardcoded test, ...) and their results will get merged by the configstore library. It's the responsability of the application using configstore to register suitable providers.
type ProviderFactory ¶ added in v0.3.0
A ProviderFactory is a function that instantiates a Provider and registers it to a store instance.
type Store ¶ added in v0.3.0
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AllowProviderOverride ¶ added in v0.3.0
func (s *Store) AllowProviderOverride()
AllowProviderOverride allows multiple calls to RegisterProvider() with the same provider name. This is useful for controlled test cases, but is not recommended in the context of a real application.
func (*Store) Env ¶ added in v0.3.0
Env registers a provider reading from the environment. Only variables beginning with "PREFIX_" will be considered. Trimmed variable names are used as keys. Keys are not case-sensitive. Underscores (_) in variable names are considered equivalent to dashes (-).
func (*Store) ErrorProvider ¶ added in v0.3.0
ErrorProvider registers a configstore provider which always returns an error.
func (*Store) File ¶ added in v0.3.0
File registers a configstore provider which reads from the file given in parameter (static content).
func (*Store) FileCustom ¶ added in v0.3.0
FileCustom registers a configstore provider which reads from the file given in parameter, and loads the content using the given unmarshal function
func (*Store) FileCustomRefresh ¶ added in v0.3.0
FileCustomRefresh registers a configstore provider which reads from the file given in parameter, and loads the content using the given unmarshal function; and watches file stat for auto refresh
func (*Store) FileList ¶ added in v0.3.0
FileList registers a configstore provider which reads from the files contained in the directory given in parameter. The content of the files should be JSON/YAML similar to the File provider.
func (*Store) FileListRefresh ¶ added in v0.6.0
FileListRefresh is similar to the FileList provider with the refresh feature enabled. Updates can be handled with the `Watch()` function.
func (*Store) FileRefresh ¶ added in v0.3.0
FileRefresh registers a configstore provider which readfs from the file given in parameter (provider watches file stat for auto refresh, watchers get notified).
func (*Store) FileTree ¶ added in v0.3.0
FileTree registers a configstore provider which reads from the files contained in the directory given in parameter. A limited hierarchy is supported: files can either be top level (in which case the file name will be used as the item key), or nested in a single sub-directory (in which case the sub-directory name will be used as item key for all the files contained in it). The content of the files should be the plain data, with no envelope. Capitalization can be used to indicate item priority for sub-directories containing multiple items which should be differentiated. Capitalized = higher priority.
Example ¶
var s = NewStore() s.FileTree("tests/fixtures/filetreeprovider2") l, err := s.GetItemList() if err != nil { fmt.Println(err) } fmt.Println("tests/fixtures/filetreeprovider2 contains:") for _, i := range l.Items { fmt.Printf("%s - %s\n", i.key, i.value) } s = NewStore() s.FileTree("tests/fixtures/filetreeprovider") l, err = s.GetItemList() if err != nil { fmt.Println(err) } fmt.Println("tests/fixtures/filetreeprovider contains:") for _, i := range l.Items { fmt.Printf("%s - %s\n", i.key, i.value) }
Output: tests/fixtures/filetreeprovider2 contains: database/dev - buz value database/dev/buz - buz value database/dev - fiz value database/dev/fiz - fiz value database/prod - prod foo value database/prod/foo - prod foo value foo - foo value tests/fixtures/filetreeprovider contains: bar/barbaz - baz_foo_value bar/barbaz/foo - baz_foo_value bar - biz value bar/biz - biz value bar - buz value bar/buz - buz value baz - baz value foo - foo value
func (*Store) FileTreeRefresh ¶ added in v0.6.0
FileTreeRefresh is similar to the FileTree provider with the refresh feature enabled. Updates can be handled with the `Watch()` function.
func (*Store) GetItem ¶ added in v0.3.0
GetItem retrieves the full item list, merging the results from all providers, then returns a single item by key. If 0 or >=2 items are present with that key, it will return an error.
func (*Store) GetItemList ¶ added in v0.3.0
GetItemList retrieves the full item list, merging the results from all providers. It does NOT cache, it's the responsability of the providers to keep an in-ram representation if desired.
func (*Store) GetItemValue ¶ added in v0.3.0
GetItemValue fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func (*Store) GetItemValueBool ¶ added in v0.3.0
GetItemValueBool fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func (*Store) GetItemValueDuration ¶ added in v0.3.0
GetItemValueDuration fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func (*Store) GetItemValueFloat ¶ added in v0.3.0
GetItemValueFloat fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func (*Store) GetItemValueInt ¶ added in v0.3.0
GetItemValueInt fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func (*Store) GetItemValueUint ¶ added in v0.3.0
GetItemValueUint fetches the full item list, merging the results from all providers, then returns a single item's value by key.
func (*Store) InMemory ¶ added in v0.3.0
func (s *Store) InMemory(name string) *InMemoryProvider
InMemory registers an InMemoryProvider with a given arbitrary name and returns it. You can append any number of items to it, see Add().
func (*Store) InitFromEnvironment ¶ added in v0.3.0
func (s *Store) InitFromEnvironment()
InitFromEnvironment initializes configuration providers via their name and an optional argument. Suitable provider factories should have been registered via RegisterProviderFactory for this to work. Built-in providers (File, FileList, FileTree, ...) are registered by default.
Valid example: CONFIGURATION_FROM=file:/etc/myfile.conf,file:/etc/myfile2.conf,filelist:/home/foobar/configs
func (*Store) NotifyIsMuted ¶ added in v0.3.0
NotifyIsMuted reports whether notifications are currently muted.
func (*Store) NotifyMute ¶ added in v0.3.0
func (s *Store) NotifyMute()
NotifyMute prevents configstore from notifying watchers on configuration changes, until MotifyUnmute() is called.
func (*Store) NotifyUnmute ¶ added in v0.3.0
func (s *Store) NotifyUnmute()
NotifyUnmute allows configstore to resume notifications to watchers on configuration changes. This will trigger a notification to catch up any change done during the time spent mute.
func (*Store) NotifyWatchers ¶ added in v0.3.0
func (s *Store) NotifyWatchers()
NotifyWatchers is used by providers to notify of configuration changes. It unblocks all the watchers which are ranging over a watch channel.
func (*Store) RegisterProvider ¶ added in v0.3.0
RegisterProvider registers a provider
func (*Store) UnregisterProvider ¶ added in v0.5.2
UnregisterProvider unregisters a provider