discovery

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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