Documentation
¶
Index ¶
- type DistLock
- type LocalLock
- func (l *LocalLock) Lock(ctx context.Context, key string) error
- func (l *LocalLock) TryLock(ctx context.Context, key string) (bool, error)
- func (l *LocalLock) TryLockWithTTL(ctx context.Context, key string, ttl time.Duration) (bool, error)
- func (l *LocalLock) Unlock(ctx context.Context, key string) error
- type RedisLock
- func (l *RedisLock) Client() *redis.Client
- func (l *RedisLock) Close() error
- func (l *RedisLock) ExtendLock(ctx context.Context, key string, ttl time.Duration) error
- func (l *RedisLock) Lock(ctx context.Context, key string) error
- func (l *RedisLock) LockWithTTL(ctx context.Context, key string, ttl time.Duration) (bool, string, error)
- func (l *RedisLock) Ping(ctx context.Context) error
- func (l *RedisLock) TryLock(ctx context.Context, key string) (bool, error)
- func (l *RedisLock) TryLockWithTTL(ctx context.Context, key string, ttl time.Duration) (bool, error)
- func (l *RedisLock) Unlock(ctx context.Context, key string) error
- func (l *RedisLock) UnlockWithValue(ctx context.Context, key, value string) error
- type Semaphore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalLock ¶
type LocalLock struct {
// contains filtered or unexported fields
}
func NewLocalLock ¶
func NewLocalLock() *LocalLock
func (*LocalLock) TryLockWithTTL ¶
type RedisLock ¶
type RedisLock struct {
// contains filtered or unexported fields
}
func NewRedisLock ¶
func (*RedisLock) ExtendLock ¶
func (*RedisLock) LockWithTTL ¶
func (*RedisLock) TryLockWithTTL ¶
Click to show internal directories.
Click to hide internal directories.