Documentation
¶
Overview ¶
Package harvester is a configuration library which helps setting up and monitoring configuration values in order to dynamically reconfigure your application.
Index ¶
- type Harvester
- type Monitor
- type OptionFunc
- func WithConsulFolderPrefixMonitor(addr, dataCenter, token, folderPrefix string, timeout time.Duration) OptionFunc
- func WithConsulMonitor(addr, dataCenter, token string, timeout time.Duration) OptionFunc
- func WithConsulSeed(addr, dataCenter, token string, timeout time.Duration) OptionFunc
- func WithConsulSeedWithPrefix(addr, dataCenter, token, folderPrefix string, timeout time.Duration) OptionFunc
- func WithRedisMonitor(client redis.UniversalClient, pollInterval time.Duration) OptionFunc
- func WithRedisSeed(client redis.UniversalClient) OptionFunc
- type Seeder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Harvester ¶
Harvester interface.
func New ¶
func New(cfg interface{}, ch chan<- config.ChangeNotification, oo ...OptionFunc) (Harvester, error)
New constructor with functional options support. Notification channel is optional and can be nil.
type Monitor ¶
Monitor defines a interface for monitoring configuration changes from various sources.
type OptionFunc ¶ added in v0.20.0
type OptionFunc func(opts *options) error
OptionFunc is used to configure harvester in an optional manner.
func WithConsulFolderPrefixMonitor ¶ added in v0.20.0
func WithConsulFolderPrefixMonitor(addr, dataCenter, token, folderPrefix string, timeout time.Duration) OptionFunc
WithConsulFolderPrefixMonitor set's up a Consul monitor to use prefixes.
func WithConsulMonitor ¶ added in v0.20.0
func WithConsulMonitor(addr, dataCenter, token string, timeout time.Duration) OptionFunc
WithConsulMonitor set's up a Consul monitor.
func WithConsulSeed ¶ added in v0.20.0
func WithConsulSeed(addr, dataCenter, token string, timeout time.Duration) OptionFunc
WithConsulSeed set's up a Consul seeder.
func WithConsulSeedWithPrefix ¶ added in v0.20.0
func WithConsulSeedWithPrefix(addr, dataCenter, token, folderPrefix string, timeout time.Duration) OptionFunc
WithConsulSeedWithPrefix set's up Consul seeder to use prefixes.
func WithRedisMonitor ¶ added in v0.20.0
func WithRedisMonitor(client redis.UniversalClient, pollInterval time.Duration) OptionFunc
WithRedisMonitor set's up a Redis monitor.
func WithRedisSeed ¶ added in v0.20.0
func WithRedisSeed(client redis.UniversalClient) OptionFunc
WithConsulSeed set's up a Redis seeder.
Directories
¶
Path | Synopsis |
---|---|
Package change supports change management of config values.
|
Package change supports change management of config values. |
Package config handles config struct parsing.
|
Package config handles config struct parsing. |
Package monitor handles config value monitoring and changing.
|
Package monitor handles config value monitoring and changing. |
consul
Package consul handles the monitor capabilities of harvester using ConsulLogger.
|
Package consul handles the monitor capabilities of harvester using ConsulLogger. |
redis
Package redis handles the monitor capabilities of harvester using redis.
|
Package redis handles the monitor capabilities of harvester using redis. |
Package seed handles seeding config values.
|
Package seed handles seeding config values. |
consul
Package consul handles seeding capabilities with consul.
|
Package consul handles seeding capabilities with consul. |
redis
Package redis handles seeding capabilities with redis.
|
Package redis handles seeding capabilities with redis. |
Package sync handles synchronized read and write access to config values.
|
Package sync handles synchronized read and write access to config values. |