election

package
v0.0.1-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdElection

type EtcdElection struct {
	// contains filtered or unexported fields
}

func NewEtcdElection

func NewEtcdElection(etcdClient *clientv3.Client, logger log.Logger) *EtcdElection

func (*EtcdElection) Champaign

func (e *EtcdElection) Champaign(ctx context.Context, prefix, name string)

func (*EtcdElection) IsLeader

func (e *EtcdElection) IsLeader() bool

func (*EtcdElection) IsReady

func (e *EtcdElection) IsReady() bool

func (*EtcdElection) Resign

func (e *EtcdElection) Resign(ctx context.Context)

Resign do resign from etcd and clear status

type Interface

type Interface interface {
	Champaign(ctx context.Context, prefix, name string)
	Resign(ctx context.Context)
	IsLeader() bool
	IsReady() bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL