Documentation ¶
Index ¶
- type Candidate
- func (c *Candidate) Campaign(ctx context.Context) error
- func (c *Candidate) Close() error
- func (c *Candidate) GetCurLeaderInfo(ctx context.Context) (string, string, int64, error)
- func (c *Candidate) Init() error
- func (c *Candidate) IsCurLeaderAtMe(ctx context.Context) (bool, error)
- func (c *Candidate) MyName() string
- func (c *Candidate) MyTerm() string
- func (c *Candidate) Proclaim(ctx context.Context, newName string) error
- func (c *Candidate) Resign(ctx context.Context) error
- type Observer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct {
// contains filtered or unexported fields
}
func NewCandidate ¶
func (*Candidate) GetCurLeaderInfo ¶
GetCurLeaderInfo 获取集群中当前作为leader的信息,如果当前集群中没有人当选leader, 则返回concurrency.ErrElectionNoLeader错误.
func (*Candidate) IsCurLeaderAtMe ¶
Click to show internal directories.
Click to hide internal directories.