Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewElection ¶
func NewElection(lg *zap.Logger, etcdCli *clientv3.Client, cfg ElectionConfig, id, key string, member Member) *election
NewElection creates an Election.
Types ¶
type Election ¶
type Election interface { // Start starts compaining the owner. Start(context.Context) // ID returns the member ID. ID() string // GetOwnerID gets the owner ID. GetOwnerID(ctx context.Context) (string, error) // Close resigns and but doesn't retire. Close() }
Election is used to campaign the owner and manage the owner information.
Click to show internal directories.
Click to hide internal directories.