Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DistributedLocker ¶
type DistributedLocker interface { // MutexLock 互斥锁,一直等待直到解锁 MutexLock(ctx context.Context, lockName string) (Unlocker, error) // EasyLock 简单锁,等待解锁或者锁定时间过期后自动解锁 EasyLock(ctx context.Context, lockName string) (Unlocker, error) }
DistributedLocker 分布式锁
func NewDistributedLocker ¶
func NewDistributedLocker(locker Locker) DistributedLocker
NewDistributedLocker 请确保传递进来的锁支持分布式锁
type LocalLocker ¶
Click to show internal directories.
Click to hide internal directories.