lock

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

type Locker struct {
	Locker *redislock.Client
}

func GetLocker

func GetLocker(rdb redis.UniversalClient) *Locker

func (*Locker) Obtain

func (l *Locker) Obtain(ctx context.Context, key string, ttl int, opt ...*redislock.Options) (*redislock.Lock, error)

func (*Locker) ObtainWaitExponentialRetry

func (l *Locker) ObtainWaitExponentialRetry(ctx context.Context, key string, ttl int, maxWaitTime int) (*redislock.Lock, error)

func (*Locker) ObtainWaitRetry

func (l *Locker) ObtainWaitRetry(ctx context.Context, key string, ttl int, retryCount int) (*redislock.Lock, error)

Jump to

Keyboard shortcuts

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