Versions in this module Expand all Collapse all v0 v0.0.1 Nov 3, 2025 Changes in this version + var ErrLockExisted = errors.New("lock already exists") + type CallBackFunc func(key string, err error) + type Executor interface + type LocalShardStore struct + type Lock struct + Key string + Token string + type LockType string + const LockTypeExclusive + const LockTypeShared + func (l LockType) String() string + type Locker interface + Acquire func(ctx context.Context, resource string, expiration time.Duration, ...) (Lock, error) + Release func(ctx context.Context, key, token string) error + Stop func() + type ManagerConfig struct + BatchSize int + MaxLocks int + NodeID string + Prefix string + QueueSize int + RefreshInterval time.Duration + ShardCount int + ShardWorkers int + type ManagerStatus bool + const ManagerStatusRunning + const ManagerStatusStopped + func (ms ManagerStatus) Bool() bool + func (ms ManagerStatus) String() string + type MutexEntry struct + type MutexRefreshTask struct + type NodeLockManager struct + func NewNodeLockManagerWithClient(cfg *ManagerConfig, l logger.Logger, client redis.Cmdable) (*NodeLockManager, error) + func NewNodeLockManagerWithCluster(cfg *ManagerConfig, l logger.Logger, client redis.Cmdable) (*NodeLockManager, error) + func (lm *NodeLockManager) Acquire(ctx context.Context, resource string, expiration time.Duration, ...) (Lock, error) + func (lm *NodeLockManager) Release(ctx context.Context, key, token string) error + func (lm *NodeLockManager) Stop() + type Priority int + const PriorityCritical + const PriorityHigh + const PriorityLow + const PriorityMedium + func (p Priority) String() string + type RefreshPriorityQueue struct + func (pq *RefreshPriorityQueue) BatchPop(batchSize int) []*RefreshTask + func (pq *RefreshPriorityQueue) Clear() + func (pq *RefreshPriorityQueue) Contains(key string) bool + func (pq *RefreshPriorityQueue) GetNextRefreshTime() (int64, bool) + func (pq *RefreshPriorityQueue) Len() int + func (pq *RefreshPriorityQueue) Peek() (*RefreshTask, bool) + func (pq *RefreshPriorityQueue) Push(key string, nextRefreshAt int64) + func (pq *RefreshPriorityQueue) Remove(key string) bool + type RefreshTask struct + Key string + NextRefreshAt int64 + type Shard struct