Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckLeaderFunc ¶
CheckLeaderFunc is all that a special backend needs to implement. It can be used with the NewPoller function to return a polling implementation of the Detector interface. This function returns true or false for leadership when there are no errors. Returned error is reported and the status of the event will be set to `Unknown`.
func Always ¶
func Always(leader bool) CheckLeaderFunc
Always is a trivial implementation that asserts the current instance to always be the leader (or not)
type Detector ¶
type Detector interface { // Start starts leadership detection Start() (<-chan Leadership, error) // Stop stops Stop() }
Detector is the interface for determining whether this instance is a leader
type Leadership ¶
Leadership is a struct that captures the leadership state, possibly error if exception occurs
Click to show internal directories.
Click to hide internal directories.