interfaces

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoEndpoints = errors.New("no endpoints available")

ErrNoEndpoints is returned by a Balancer when no endpoints are available, e.g. because service discovery has not yet received any instances.

Functions

This section is empty.

Types

type Balancer

type Balancer interface {
	Endpoint() (endpoint.Endpoint, error)
}

Balancer selects one Endpoint from a pool of available endpoints. Implementations may use any strategy: round-robin, random, least-loaded, etc.

type Instancer

type Instancer interface {
	Register(chan<- events.Event)
	Deregister(chan<- events.Event)
	Stop()
}

Instancer is the source of service-discovery events. Implementations (e.g. consul.Instancer, instance.Cache) push Event values to all registered channels whenever the set of healthy instances changes.

type Registrar

type Registrar interface {
	Register()
	Deregister()
}

Registrar registers and deregisters a service instance with a service registry (e.g. Consul). Call Register on startup and Deregister on shutdown.

Jump to

Keyboard shortcuts

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