redis

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWatchMaxRetries = errors.New("Maximum number of watch retries reached")
)

Functions

func AnyEmptyErr

func AnyEmptyErr(errs ...error) bool

Types

type Client

type Client struct {
	*redis.Client
}

func (*Client) AllExist

func (r *Client) AllExist(
	ctx context.Context,
	keys ...string,
) (allExist bool, notExistsIndex int, err error)

func (*Client) HSetTTL

func (r *Client) HSetTTL(
	ctx context.Context,
	key string,
	values map[string]interface{},
	TTL time.Duration,
) error

func (*Client) OptimisticLockTx

func (r *Client) OptimisticLockTx(
	ctx context.Context,
	maxRetries int,
	txFn RedisTxFn,
	keys ...string,
) error

func (*Client) SAddTTL

func (r *Client) SAddTTL(
	ctx context.Context,
	key string,
	TTL time.Duration,
	members ...interface{},
) error

type Cmdable

type Cmdable interface {
	redis.Cmdable
	OptimisticLockTx(
		ctx context.Context,
		maxRetries int,
		txFn RedisTxFn,
		keys ...string,
	) error
	HSetTTL(
		ctx context.Context,
		key string,
		values map[string]interface{},
		TTL time.Duration,
	) error
	SAddTTL(
		ctx context.Context,
		key string,
		TTL time.Duration,
		members ...interface{},
	) error
	AllExist(
		ctx context.Context,
		keys ...string,
	) (allExist bool, notExistsIndex int, err error)
}

func New

func New(client *redis.Client) Cmdable

type RedisTxFn

type RedisTxFn = func(*redis.Tx) error

Jump to

Keyboard shortcuts

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