Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotSupported is returned when a discovery service is not supported. ErrNotSupported = errors.New("discovery service not supported") // ErrNotImplemented is returned when discovery feature is not implemented // by discovery backend. ErrNotImplemented = errors.New("not implemented in this discovery service") )
Functions ¶
func ParseAdvertise ¶
ParseAdvertise parses the --cluster-advertise daemon config which accepts <ip-address>:<port> or <interface-name>:<port>
Types ¶
type Backend ¶
type Backend interface {
// Watcher must be provided by every backend.
Watcher
// Initialize the discovery with URIs, a heartbeat, a ttl and optional settings.
Initialize(string, time.Duration, time.Duration, map[string]string) error
// Register to the discovery.
Register(string) error
}
Backend is implemented by discovery backends which manage cluster entries.
type Entries ¶
type Entries []*Entry
Entries is a list of *Entry with some helpers.
func CreateEntries ¶
CreateEntries returns an array of entries based on the given addresses.
type Entry ¶
An Entry represents a host.
type Watcher ¶
type Watcher interface {
// Watch the discovery for entry changes.
// Returns a channel that will receive changes or an error.
// Providing a non-nil stopCh can be used to stop watching.
Watch(stopCh <-chan struct{}) (<-chan Entries, <-chan error)
}
Watcher provides watching over a cluster for nodes joining and leaving.
Click to show internal directories.
Click to hide internal directories.