redis

package
v2.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHEDOC_KEY    = "key"
	CACHEDOC_VAL    = "val"
	CACHEDOC_LABELS = "labels"
	CACHEDOC_TS     = "ts"
)

Variables

Logger is the package-level logger for redis cache operations. By default, it uses the DefaultLogger which wraps slog. You can replace it with your own implementation using SetLogger.

Functions

func NewBucket

func NewBucket[T any](cli model.CacheClient, name string, coder model.Coder) (model.CacheBucket, error)

func NewCacheDoc

func NewCacheDoc[T any](bucket *bucket[T], key string) *cacheDoc[T]

func NewClient

func NewClient(url, pass string, dbIndex int, opts ...ClientOption) model.CacheClient

func SetLogger

func SetLogger(logger model.Logger)

SetLogger sets the package-level logger for all redis cache operations. This should be called once at application startup before creating any cache clients.

Types

type ClientOption

type ClientOption func(*client)

func WithTimeout

func WithTimeout(d time.Duration) ClientOption

Jump to

Keyboard shortcuts

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