redislock

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLockExists redis lock exists
	ErrRedisLockExists = errors.New("redis lock already exists")

	// ErrRedisClientInvalid redis client invalid
	ErrRedisClientInvalid = errors.New("redis client is nil")

	// ErrRedisLockKeyInvalid lock key invalid
	ErrRedisLockKeyInvalid = errors.New("lock key is empty")
)
View Source
var DefaultExpire = 10

DefaultExpire 加锁的key默认过期时间,单位s

Functions

func New

func New(client *redis.Client, key string, val interface{}, expire ...int) (*lock, error)

New 实例化redis分布式锁实例对象

Types

This section is empty.

Jump to

Keyboard shortcuts

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