distlock

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisLockerTries      = 3
	RedisLockerRetryDelay = 2 * time.Second
	RedisLockerExpiry     = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DistLock

type DistLock struct {
	Pool   *redis.Pool
	Option Option
}

func New

func New(pool *redis.Pool, option ...Option) (distLock *DistLock)

func (*DistLock) SetCacheWithDistLock

func (d *DistLock) SetCacheWithDistLock(key string, ttl interface{}, value interface{}) (err error)

type Option

type Option struct {
	RedisLockerTries      int
	RedisLockerRetryDelay time.Duration
	RedisLockerExpiry     time.Duration
}

Jump to

Keyboard shortcuts

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