Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConnectedEvent = iota DisconnectedEvent LeaderUpgradeEvent DowngradeEvent )
View Source
const EventsChanSize = 10
View Source
const (
LeaderChanSize = 6
)
Variables ¶
View Source
var ( AlreadyRegisteredError = errors.New("already registered") NotRegisteredError = errors.New("not registered") NotEnrolledError = errors.New("candidate is not presently enrolled in the election") InvalidChildrenLenError = errors.New("0 children listed afer created protected ephemeral sequential - this should never happen") DefaultConnCheckFrequency = 5 * time.Second // Default frequency of connection checks. )
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct { ElectionPath string Node *Node ConnCheckFrequency time.Duration // Frequency of connection checks. Debug bool // contains filtered or unexported fields }
func (*Candidate) Participants ¶
func (*Candidate) Registered ¶
func (*Candidate) Unregister ¶
type Participant ¶
type Participant struct { Config ParticipantConfig EventsChan <-chan Event StopChan chan<- struct{} }
func Participate ¶
func Participate(config ParticipantConfig) (participant Participant)
type ParticipantConfig ¶
Click to show internal directories.
Click to hide internal directories.