Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Leadership ¶
type Leadership struct {
// contains filtered or unexported fields
}
Leadership manages the leadership for this replica. It will elect and re-elect leadership, returning contexts which cancel on lost quorum.
func New ¶
func New(opts Options) *Leadership
func (*Leadership) Elect ¶ added in v0.4.0
Elect will elect this replica as the leader. It will return a context which will cancel when the leadership quorum is lost.
type Options ¶
type Options struct { // Log is the logger for the leadership. Log logr.Logger // Client is the etcd client. Client client.Interface // Key is the ETCD key generator. Key *key.Key // ReplicaData is the replicaData for the instance using the cron library. // This will contain data like host + port for keeping track of active replicas. ReplicaData *anypb.Any }
Options are the options for the Leadership.
Click to show internal directories.
Click to hide internal directories.