redlock

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedLock

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

func NewRedLock

func NewRedLock(
	redis connectors.DBConnector[*redis.Client, *types.RedisTx],
	opts ...RedLockOption,
) (*RedLock, error)

func (*RedLock) DoUnderLock

func (rl *RedLock) DoUnderLock(ctx context.Context, key string, f func(ctx context.Context) error) error

type RedLockOption

type RedLockOption func(rl *RedLock)

func WithExpireOption

func WithExpireOption(expire time.Duration) RedLockOption

func WithRetryCountOption

func WithRetryCountOption(retryCount int) RedLockOption

func WithRetryDelayOption

func WithRetryDelayOption(delay time.Duration) RedLockOption

Jump to

Keyboard shortcuts

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