locks

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockManager

type LockManager interface {
	Lock(context.Context, string) error
	Unlock(context.Context) error
}

type RedisLockManager

type RedisLockManager struct {
	RNonClusteredClient *redis.Client
	RedisLockClient     *redislock.Client
	RedisLock           *redislock.Lock
}

func NewRedisLockManager

func NewRedisLockManager(redisNClient *redis.Client) *RedisLockManager

func (*RedisLockManager) Lock

func (r *RedisLockManager) Lock(ctx context.Context, key string) error

func (*RedisLockManager) Unlock

func (r *RedisLockManager) Unlock(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL