Versions in this module Expand all Collapse all v1 v1.0.1 Jan 9, 2024 Changes in this version + var ManagedIndexes = []mongostore.Index + var ZeroCandidateId = CandidateId(primitive.NilObjectID) + func CandidateIdCompare(a CandidateId, b CandidateId) int + type CandidateId primitive.ObjectID + func CandidateIdPointerSliceToSlice(inputSlice []*CandidateId) (outputSlice []CandidateId) + func MakeCandidateId() CandidateId + func OrganizationidSliceToPointerSlice(inputSlice []CandidateId) (outputSlice []*CandidateId) + func (i *CandidateId) MarshalText() ([]byte, error) + func (i *CandidateId) UnmarshalBSONValue(t bsontype.Type, raw []byte) error + func (i *CandidateId) UnmarshalJSON(data []byte) (err error) + func (i *CandidateId) UnmarshalText(text []byte) error + func (i CandidateId) Clone() (clone CandidateId) + func (i CandidateId) Compare(x CandidateId) int + func (i CandidateId) Equal(x CandidateId) bool + func (i CandidateId) MarshalBSONValue() (bsontype.Type, []byte, error) + func (i CandidateId) MarshalJSON() ([]byte, error) + func (i CandidateId) String() string + type ElectedLeader struct + Boundary string + LeaderHostname string + LeaderPort uint64 + LeaderUUID CandidateId + TTLExpire time.Time + func (el ElectedLeader) ConnectionString() string + type Elector struct + func NewElector(ctx context.Context, database *mongostore.DataStore, boundary string, ...) (e *Elector, err error) + func (e *Elector) Close() + func (e *Elector) GetElectedLeader() *ElectedLeader + func (e *Elector) Status() (status *ElectorStatus) + type ElectorOptions struct + LeaderHeartbeatSeconds uint64 + LeaderTTLSeconds uint64 + func NewElectorOptions() ElectorOptions + type ElectorStatus struct + Boundary string + ElectedLeader *ElectedLeader + Hostname string + Id CandidateId + IsLeader bool + Port uint64 + Running bool + type FollowerWorker interface + Start func(ctx context.Context, thisLeaderUUID CandidateId) + Stop func() + type LeaderWorker interface + Start func(ctx context.Context) + Stop func()