Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker implements distributed locking using Redis SET NX EX + Lua scripts.
func NewLocker ¶
func NewLocker(cfg LockerConfig) *Locker
NewLocker creates a new Redis-based distributed locker.
type LockerConfig ¶
type LockerConfig struct {
RDB rueidis.Client
Prefix string
LockTTL time.Duration // Default: 30s
AutoExtendInterval time.Duration // Default: 0 (no auto-extend)
Logger gochainedlog.Logger
}
LockerConfig holds configuration for the locker.
type RedisLock ¶
type RedisLock struct {
// contains filtered or unexported fields
}
RedisLock represents a held distributed lock.
Click to show internal directories.
Click to hide internal directories.