Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidOnStartedLeadingCallback is thrown if OnStartedLeading callback is not defined ErrInvalidOnStartedLeadingCallback = fmt.Errorf("OnStartedLeading callback must not be nil") // ErrInvalidOnStoppedLeadingCallback is thrown if OnStoppedLeading callback is not defined ErrInvalidOnStoppedLeadingCallback = fmt.Errorf("OnStoppedLeading callback must not be nil") // ErrInvalidLockPath is thrown if lock path for lease is not defined ErrInvalidLockPath = fmt.Errorf("lock path must not be nil") )
Errors raised by package
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct {
// contains filtered or unexported fields
}
Candidate is a leader election candidate.
type Config ¶
type Config struct { // LockPath is key in registry that will be used for locking LockPath string // Callbacks are callbacks that are triggered during certain lifecycle // events of the LeaderElector Callbacks LeaderCallbacks }
Config for leaderelector
type LeaderCallbacks ¶
type LeaderCallbacks struct { // OnStartedLeading is called when a LeaderElector client starts leading OnStartedLeading func(context.Context) error // OnStoppedLeading is called when a LeaderElector client stops leading OnStoppedLeading func(ctx context.Context) }
LeaderCallbacks are callbacks that are triggered during certain lifecycle events of the LeaderElector. These are invoked asynchronously.
Click to show internal directories.
Click to hide internal directories.