Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailabilityCriteria ¶
type AvailabilityCriteria func() bool
type Candidate ¶
type Candidate interface { Init(context.Context) Deinit(context.Context) AddAvailabilityCriteria(AvailabilityCriteria) TryBecomeLeader(context.Context) bool RenewLeadershipLease(context.Context) IsAvailable() bool IsCurrentLeader(context.Context) bool UpdateCandidateStatus(context.Context, bool) TrimCandidates(context.Context) GetLeaderCandidates(context.Context) []string SetState(context.Context, State) SetLeaderAndCandidateFields(context.Context) DoWork(context.Context) LosingLeadership() signalslots.Signal BecameLeader() signalslots.Signal BecameFollower() signalslots.Signal IsCurrentLeaderCheck() <-chan time.Time CandidateUpdate() <-chan time.Time LeaderAttempt() <-chan time.Time LeaseRenewal() <-chan time.Time }
type Store ¶ added in v0.0.50
type Store interface { Connect(context.Context) Disconnect(context.Context) IsConnected(context.Context) bool TempSet(ctx context.Context, key string, value string, expiration time.Duration) bool TempGet(ctx context.Context, key string) string TempExpire(ctx context.Context, key string, expiration time.Duration) TempDel(ctx context.Context, key string) SortedSetAdd(ctx context.Context, key string, member string, score float64) int64 SortedSetRemove(ctx context.Context, key string, member string) int64 SortedSetRemoveRangeByRank(ctx context.Context, key string, start, stop int64) int64 SortedSetRangeByScoreWithScores(ctx context.Context, key string, min, max string) []store.SortedSetMember }
Click to show internal directories.
Click to hide internal directories.