Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Name is the name of the loader Name string // StopOnFailure tells whether a failure to load configs should closed the config and all registered closers StopOnFailure bool // Client is the etcd client Client *clientv3.Client // Keys is the list of keys to fetch Keys []Key // Timeout is the timeout duration when fetching a key Timeout time.Duration // Prefix is a prefix to prepend keys when adding into the konfig.Store Prefix string // Replacer is a Replacer for the key before adding to the konfig.Store Replacer nstrings.Replacer // Watch tells whether there should be a watcher with the loader Watch bool // Rater is the rater to pass to the poll watcher Rater kwpoll.Rater // MaxRetry is the maximum number of times we can retry to load if it fails MaxRetry int // RetryDelay is the time between each retry when a load fails RetryDelay time.Duration // Debug sets debug mode on the etcdloader Debug bool // Contexter provides a context, default value is contexter wrapping context package. It is used mostly for testing. Contexter ncontext.Contexter // contains filtered or unexported fields }
Config is the structure representing the config of a Loader
type Key ¶
type Key struct { // Key is the etcd key Key string // Parser is the parser for the key // If nil, the value is casted to a string before adding to the config.Store Parser parser.Parser }
Key is an Etcd Key to load
type Loader ¶
type Loader struct { *kwpoll.PollWatcher // contains filtered or unexported fields }
Loader is the structure of a loader
func (*Loader) RetryDelay ¶
RetryDelay is the delay between each retry
func (*Loader) StopOnFailure ¶
StopOnFailure returns whether a load failure should stop the config and the registered closers
Click to show internal directories.
Click to hide internal directories.