go_redis

package module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 6 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[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis[K comparable, V any](cli *redis.Client, ctxProvider func(key any) context.Context) *Redis[K, V]

func (*Redis[K, V]) Clear

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

func (*Redis[K, V]) Get

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

func (*Redis[K, V]) GetOrProvide

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

func (*Redis[K, V]) GetOrProvideAsync

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

func (*Redis[K, V]) Remove

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

type RedisClientErrorsMonitoring

type RedisClientErrorsMonitoring interface {
	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