Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options interface { // Client sets the etcd client Client() *clientv3.Client // SetClient sets the etcd client SetClient(cli *clientv3.Client) Options // UpdateFn is the function called when a notification on a key is received UpdateFn() UpdateFn // SetUpdateFn sets the UpdateFn SetUpdateFn(f UpdateFn) Options // TickAndStopFn is the function called periodically to check if a watch should be stopped TickAndStopFn() TickAndStopFn // SetTickAndStopFn sets the TickAndStopFn SetTickAndStopFn(f TickAndStopFn) Options // WatchOptions is a set of options for the etcd watch WatchOptions() []clientv3.OpOption // SetWatchOptions sets the WatchOptions SetWatchOptions(opts []clientv3.OpOption) Options // WatchChanCheckInterval will be used to periodically check if a watch chan // is no longer being subscribed and should be closed WatchChanCheckInterval() time.Duration // SetWatchChanCheckInterval sets the WatchChanCheckInterval SetWatchChanCheckInterval(t time.Duration) Options // WatchChanResetInterval is the delay before resetting the etcd watch chan WatchChanResetInterval() time.Duration // SetWatchChanResetInterval sets the WatchChanResetInterval SetWatchChanResetInterval(t time.Duration) Options // WatchChanInitTimeout is the timeout for a watchChan initialization WatchChanInitTimeout() time.Duration // SetWatchChanInitTimeout sets the WatchChanInitTimeout SetWatchChanInitTimeout(t time.Duration) Options // InstrumentsOptions is the instrument options InstrumentsOptions() instrument.Options // SetInstrumentsOptions sets the InstrumentsOptions SetInstrumentsOptions(iopts instrument.Options) Options // Validate validates the options Validate() error }
Options are options for the etcd watch helper
type TickAndStopFn ¶
TickAndStopFn is called every once a while to check and stop the watch if needed
type WatchManager ¶
type WatchManager interface { // Watch watches the key forever until the CheckAndStopFn returns true Watch(key string) }
WatchManager manages etcd watch on a key
func NewWatchManager ¶
func NewWatchManager(opts Options) (WatchManager, error)
NewWatchManager creates a new watch manager
Click to show internal directories.
Click to hide internal directories.