locker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock interface {
	Release(ctx context.Context) error
	Refresh(ctx context.Context, duration time.Duration) error
	Key() string
}

type Locker

type Locker interface {
	Acquire(ctx context.Context, key string, ttl time.Duration, metadata string) (Lock, error)
}

type RedisLock

type RedisLock struct {
	// contains filtered or unexported fields
}

func (*RedisLock) Key

func (r *RedisLock) Key() string

func (*RedisLock) Refresh

func (r *RedisLock) Refresh(ctx context.Context, duration time.Duration) error

func (*RedisLock) Release

func (r *RedisLock) Release(ctx context.Context) error

type RedisLocker

type RedisLocker struct {
	// contains filtered or unexported fields
}

func NewRedisLocker

func NewRedisLocker(rdb *redis.Client) *RedisLocker

func (*RedisLocker) Acquire

func (rl *RedisLocker) Acquire(ctx context.Context, key string, ttl time.Duration, metadata string) (Lock, error)

Jump to

Keyboard shortcuts

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