Versions in this module Expand all Collapse all v1 v1.4.4 Nov 14, 2019 Changes in this version + const DefLeaderAliveThreshold + const DefLeaderElectionDuration + const DefMembershipSampleInterval + const DefStartupGracePeriod + type ElectionConfig struct + LeaderAliveThreshold time.Duration + LeaderElectionDuration time.Duration + MembershipSampleInterval time.Duration + StartupGracePeriod time.Duration + type LeaderElectionAdapter interface + Accept func() <-chan Msg + CreateMessage func(isDeclaration bool) Msg + Gossip func(Msg) + Peers func() []Peer + ReportMetrics func(isLeader bool) + func NewAdapter(gossip gossip, pkiid common.PKIidType, channel common.ChainID, ...) LeaderElectionAdapter + type LeaderElectionService interface + IsLeader func() bool + Stop func() + Yield func() + func NewLeaderElectionService(adapter LeaderElectionAdapter, id string, callback leadershipCallback, ...) LeaderElectionService + type Msg interface + IsDeclaration func() bool + IsProposal func() bool + SenderID func() peerID + type Peer interface + ID func() peerID