redislock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 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 RedisLock

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

RedisLock is a redis SET NX based lock

func New

func New(cli redislock.RedisClient, key string, waitTimeout, lockTTL time.Duration) (*RedisLock, error)

New creates a lock on key, waiting at most waitTimeout to acquire it and holding it for lockTTL.

func (*RedisLock) Lock

func (r *RedisLock) Lock(ctx context.Context) (context.Context, error)

func (*RedisLock) Unlock

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

Jump to

Keyboard shortcuts

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