goredis

package module
v2.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

type Redis[V any] struct {
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis[V any](cli *redis.Client, keyPrefix string, monitoring RedisClientErrorsMonitoring) *Redis[V]

func (*Redis[V]) Clear

func (r *Redis[V]) Clear(ctx context.Context)

func (*Redis[V]) Get

func (r *Redis[V]) Get(ctx context.Context, key any) (V, bool)

func (*Redis[V]) GetOrProvide

func (r *Redis[V]) GetOrProvide(ctx context.Context, key any, valueProvider sweet.ValueProvider[V]) (V, bool)

func (*Redis[V]) GetOrProvideAsync

func (r *Redis[V]) GetOrProvideAsync(ctx context.Context, key any, valueProvider sweet.ValueProvider[V], defaultValue V) (V, bool)

func (*Redis[V]) Remove

func (r *Redis[V]) Remove(ctx context.Context, key any)

type RedisClientErrorsMonitoring

type RedisClientErrorsMonitoring interface {
	GetFailed(ctx context.Context, key string, err error)
	SetFailed(ctx context.Context, key string, err error)
	RemoveFailed(ctx context.Context, key string, err error)
}

Jump to

Keyboard shortcuts

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