redis

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultLockDuration  = time.Minute
	DefaultRetryInterval = time.Second
)

Variables

This section is empty.

Functions

func Module

func Module(cfg Config) fx.Option

Types

type BoolCmd

type BoolCmd = redis.BoolCmd

type Client

type Client interface {
	SetNX(ctx context.Context, lk string, rv interface{}, duration time.Duration) *BoolCmd
	Get(ctx context.Context, lk string) *StringCmd
	Del(ctx context.Context, lk ...string) *IntCmd
}

type Config

type Config struct {
	Url          string
	LockDuration time.Duration
	LockRetry    time.Duration
	TLSConfig    *tls.Config
}

type IntCmd

type IntCmd = redis.IntCmd

type Lock

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

func NewLock

func NewLock(client Client, lockDuration, retry time.Duration) *Lock

func (Lock) Lock

func (l Lock) Lock(ctx context.Context, name string) (middlewares.Unlock, error)

type Options

type Options = redis.Options

type StringCmd

type StringCmd = redis.StringCmd

Jump to

Keyboard shortcuts

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