const NoLease …
const MaxLeaseTTL …
var v3_6 …
var forever …
var defaultLeaseRevokeRate …
var leaseCheckpointRate …
var defaultLeaseCheckpointInterval …
var maxLeaseCheckpointBatchSize …
var defaultExpiredleaseRetryInterval …
var ErrNotPrimary …
var ErrLeaseNotFound …
var ErrLeaseExists …
var ErrLeaseTTLTooLarge …
type TxnDelete …
type RangeDeleter …
type Checkpointer …
type LeaseID …
type Lessor …
type lessor …
type cluster …
type LessorConfig …
func NewLessor(lg *zap.Logger, b backend.Backend, cluster cluster, cfg LessorConfig) Lessor { … }
func newLessor(lg *zap.Logger, b backend.Backend, cluster cluster, cfg LessorConfig) *lessor { … }
func (le *lessor) isPrimary() bool { … }
func (le *lessor) SetRangeDeleter(rd RangeDeleter) { … }
func (le *lessor) SetCheckpointer(cp Checkpointer) { … }
func (le *lessor) Grant(id LeaseID, ttl int64) (*Lease, error) { … }
func (le *lessor) Revoke(id LeaseID) error { … }
func (le *lessor) Checkpoint(id LeaseID, remainingTTL int64) error { … }
func (le *lessor) shouldPersistCheckpoints() bool { … }
func greaterOrEqual(first, second semver.Version) bool { … }
func (le *lessor) Renew(id LeaseID) (int64, error) { … }
func (le *lessor) Lookup(id LeaseID) *Lease { … }
func (le *lessor) unsafeLeases() []*Lease { … }
func (le *lessor) Leases() []*Lease { … }
func (le *lessor) Promote(extend time.Duration) { … }
type leasesByExpiry …
func (le leasesByExpiry) Len() int { … }
func (le leasesByExpiry) Less(i, j int) bool { … }
func (le leasesByExpiry) Swap(i, j int) { … }
func (le *lessor) Demote() { … }
func (le *lessor) Attach(id LeaseID, items []LeaseItem) error { … }
func (le *lessor) GetLease(item LeaseItem) LeaseID { … }
func (le *lessor) Detach(id LeaseID, items []LeaseItem) error { … }
func (le *lessor) Recover(b backend.Backend, rd RangeDeleter) { … }
func (le *lessor) ExpiredLeasesC() <-chan []*Lease { … }
func (le *lessor) Stop() { … }
func (le *lessor) runLoop() { … }
func (le *lessor) revokeExpiredLeases() { … }
func (le *lessor) checkpointScheduledLeases() { … }
func (le *lessor) clearScheduledLeasesCheckpoints() { … }
func (le *lessor) clearLeaseExpiredNotifier() { … }
func (le *lessor) expireExists() (l *Lease, ok bool, next bool) { … }
func (le *lessor) findExpiredLeases(limit int) []*Lease { … }
func (le *lessor) scheduleCheckpointIfNeeded(lease *Lease) { … }
func (le *lessor) findDueScheduledCheckpoints(checkpointLimit int) []*pb.LeaseCheckpoint { … }
func (le *lessor) initAndRecover() { … }
type Lease …
func NewLease(id LeaseID, ttl int64) *Lease { … }
func (l *Lease) expired() bool { … }
func (l *Lease) persistTo(b backend.Backend) { … }
func (l *Lease) TTL() int64 { … }
func (l *Lease) SetLeaseItem(item LeaseItem) { … }
func (l *Lease) RemainingTTL() int64 { … }
func (l *Lease) refresh(extend time.Duration) { … }
func (l *Lease) forever() { … }
func (l *Lease) Demoted() bool { … }
func (l *Lease) Keys() []string { … }
func (l *Lease) Remaining() time.Duration { … }
type LeaseItem …
func int64ToBytes(n int64) []byte { … }
func bytesToLeaseID(bytes []byte) int64 { … }
func unsafeGetAllLeases(tx backend.ReadTx) []*leasepb.Lease { … }
type FakeLessor …
func (fl *FakeLessor) SetRangeDeleter(dr RangeDeleter) { … }
func (fl *FakeLessor) SetCheckpointer(cp Checkpointer) { … }
func (fl *FakeLessor) Grant(id LeaseID, ttl int64) (*Lease, error) { … }
func (fl *FakeLessor) Revoke(id LeaseID) error { … }
func (fl *FakeLessor) Checkpoint(id LeaseID, remainingTTL int64) error { … }
func (fl *FakeLessor) Attach(id LeaseID, items []LeaseItem) error { … }
func (fl *FakeLessor) GetLease(item LeaseItem) LeaseID { … }
func (fl *FakeLessor) Detach(id LeaseID, items []LeaseItem) error { … }
func (fl *FakeLessor) Promote(extend time.Duration) { … }
func (fl *FakeLessor) Demote() { … }
func (fl *FakeLessor) Renew(id LeaseID) (int64, error) { … }
func (fl *FakeLessor) Lookup(id LeaseID) *Lease { … }
func (fl *FakeLessor) Leases() []*Lease { … }
func (fl *FakeLessor) ExpiredLeasesC() <-chan []*Lease { … }
func (fl *FakeLessor) Recover(b backend.Backend, rd RangeDeleter) { … }
func (fl *FakeLessor) Stop() { … }
type FakeTxnDelete …
func (ftd *FakeTxnDelete) DeleteRange(key, end []byte) (n, rev int64) { … }
func (ftd *FakeTxnDelete) End() { … }