discovery

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discoverer

type Discoverer interface {
	Instances() ([]string, error)
}

Discoverer listens to a service discovery system and yields a set of identical instance locations. An error indicates a problem with connectivity to the service discovery system, or within the system itself; a subscriber may yield no endpoints without error.

type Dispatcher

type Dispatcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Dispatcher can register/unregister observers and pass notifications to them

func (*Dispatcher) Notify

func (d *Dispatcher) Notify(instances []string)

Notify sends instances to all Observers

func (*Dispatcher) Register

func (d *Dispatcher) Register(ch chan<- []string)

Register adds an observer to the list.

func (*Dispatcher) Unregister

func (d *Dispatcher) Unregister(ch chan<- []string)

Unregister removes an observer from the list.

type FixedDiscoverer

type FixedDiscoverer []string

FixedDiscoverer yields a fixed set of instances.

func (FixedDiscoverer) Instances

func (d FixedDiscoverer) Instances() ([]string, error)

Instances implements Discoverer.

type Notifier

type Notifier interface {
	Register(chan<- []string)
	Unregister(chan<- []string)
}

Notifier listens to a service discovery system and notifies registered observers of changes in the resource instances. A complete set of instances is always provided to the observers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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