Documentation ¶
Index ¶
Constants ¶
const DefaultDiscoveryPollInterval = 1 * time.Second
DefaultDiscoveryPollInterval is the default used for the discovery monitor's poll interval, if no other value is specified. Currently, all existing ServiceDiscovery adapters use caching with background polling, so the 1 second polling here is basically polling a local cache only. Note: this will be removed once the ServiceDiscovery interface exposes a Watch() mechanism.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryConfig ¶ added in v1.0.0
type DiscoveryConfig struct { Discovery api.ServiceDiscovery Listeners []DiscoveryListener PollInterval time.Duration }
DiscoveryConfig holds configuration options for the discovery monitor
type DiscoveryListener ¶ added in v1.0.0
type DiscoveryListener interface {
CatalogChange([]api.ServiceInstance) error
}
DiscoveryListener is notified of changes to the discovery catalog
type DiscoveryMonitor ¶ added in v1.0.0
type DiscoveryMonitor interface { Monitor AddListener(DiscoveryListener) RemoveListener(DiscoveryListener) }
DiscoveryMonitor interface.
func NewDiscoveryMonitor ¶ added in v1.0.0
func NewDiscoveryMonitor(conf DiscoveryConfig) DiscoveryMonitor
NewDiscoveryMonitor instantiates a new discovery monitor
type RulesConfig ¶ added in v1.0.0
type RulesConfig struct { Rules api.RulesService Listeners []RulesListener PollInterval time.Duration }
RulesConfig holds configuration options for the rules monitor.
type RulesListener ¶ added in v1.0.0
RulesListener is notified of changes to rules
type RulesMonitor ¶ added in v1.0.0
type RulesMonitor interface { Monitor AddListener(RulesListener) RemoveListener(RulesListener) }
RulesMonitor interface.
func NewRulesMonitor ¶ added in v1.0.0
func NewRulesMonitor(conf RulesConfig) RulesMonitor
NewRulesMonitor instantiates a new rules monitor