monitor

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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 ByID

type ByID []*api.ServiceInstance

ByID sorts by ID

func (ByID) Len

func (a ByID) Len() int

Len of the array

func (ByID) Less

func (a ByID) Less(i, j int) bool

Less i and j

func (ByID) Swap

func (a ByID) Swap(i, j int)

Swap i and j

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 Monitor

type Monitor interface {
	Start() error
	Stop() error
}

Monitor a source

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

type RulesListener interface {
	RuleChange([]api.Rule) error
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL