Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callbacks ¶
type Callbacks struct {
// OnStartedLeading is called when this instance becomes the leader.
OnStartedLeading func(ctx context.Context)
// OnStoppedLeading is called when this instance loses leadership.
OnStoppedLeading func()
// OnNewLeader is called when a new leader is elected.
OnNewLeader func(identity string)
}
Callbacks defines the callbacks for leader election events.
type Config ¶
type Config struct {
// Namespace is the namespace for the lease resource.
Namespace string
// Name is the name of the lease resource.
Name string
// LeaseDuration is the duration of the lease.
LeaseDuration time.Duration
// RenewDeadline is the deadline for renewing the lease.
RenewDeadline time.Duration
// RetryPeriod is the period between retries.
RetryPeriod time.Duration
}
Config holds leader election configuration.
Click to show internal directories.
Click to hide internal directories.