Documentation ¶
Index ¶
- Constants
- func New(store data.Store) leadership.Candidate
- type Candidate
- func (c *Candidate) AddAvailabilityCriteria(criteria leadership.AvailabilityCriteria)
- func (c *Candidate) BecameFollower() signalslots.Signal
- func (c *Candidate) BecameLeader() signalslots.Signal
- func (c *Candidate) BecameUnavailable() signalslots.Signal
- func (c *Candidate) CandidateUpdate() <-chan time.Time
- func (c *Candidate) ClearLeaderAndCandidateFields()
- func (c *Candidate) Deinit()
- func (c *Candidate) DoWork()
- func (c *Candidate) GetLeaderCandidates() []string
- func (c *Candidate) Init()
- func (c *Candidate) IsAvailable() bool
- func (c *Candidate) IsCurrentLeader() bool
- func (c *Candidate) LeaderAttempt() <-chan time.Time
- func (c *Candidate) LeaseRenewal() <-chan time.Time
- func (c *Candidate) LosingLeadership() signalslots.Signal
- func (c *Candidate) RenewLeadershipLease()
- func (c *Candidate) SetLeaderAndCandidateFields()
- func (c *Candidate) SetState(newState leadership.State)
- func (c *Candidate) TrimCandidates()
- func (c *Candidate) TryBecomeLeader() bool
- func (c *Candidate) UpdateCandidateStatus(available bool)
- type KeyGenerator
Constants ¶
View Source
const LeaseTimeout = 15 * time.Second
View Source
const MaxCandidates = 5
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Candidate ¶
type Candidate struct {
// contains filtered or unexported fields
}
func (*Candidate) AddAvailabilityCriteria ¶
func (c *Candidate) AddAvailabilityCriteria(criteria leadership.AvailabilityCriteria)
func (*Candidate) BecameFollower ¶
func (c *Candidate) BecameFollower() signalslots.Signal
func (*Candidate) BecameLeader ¶
func (c *Candidate) BecameLeader() signalslots.Signal
func (*Candidate) BecameUnavailable ¶
func (c *Candidate) BecameUnavailable() signalslots.Signal
func (*Candidate) CandidateUpdate ¶
func (*Candidate) ClearLeaderAndCandidateFields ¶
func (c *Candidate) ClearLeaderAndCandidateFields()
func (*Candidate) GetLeaderCandidates ¶
func (*Candidate) IsAvailable ¶
func (*Candidate) IsCurrentLeader ¶
func (*Candidate) LeaderAttempt ¶
func (*Candidate) LeaseRenewal ¶
func (*Candidate) LosingLeadership ¶
func (c *Candidate) LosingLeadership() signalslots.Signal
func (*Candidate) RenewLeadershipLease ¶
func (c *Candidate) RenewLeadershipLease()
func (*Candidate) SetLeaderAndCandidateFields ¶
func (c *Candidate) SetLeaderAndCandidateFields()
func (*Candidate) SetState ¶
func (c *Candidate) SetState(newState leadership.State)
func (*Candidate) TrimCandidates ¶
func (c *Candidate) TrimCandidates()
func (*Candidate) TryBecomeLeader ¶
func (*Candidate) UpdateCandidateStatus ¶
type KeyGenerator ¶
type KeyGenerator struct{}
leader:<appName>:current leader:<appName>:candidates
func (*KeyGenerator) GetLeaderCandidatesKey ¶
func (g *KeyGenerator) GetLeaderCandidatesKey(app string) string
func (*KeyGenerator) GetLeaderKey ¶
func (g *KeyGenerator) GetLeaderKey(app string) string
Click to show internal directories.
Click to hide internal directories.