Documentation
¶
Index ¶
- Constants
- Variables
- func NewBucket[T any](cli model.CacheClient, name string, coder model.Coder) (model.CacheBucket, error)
- func NewCacheDoc[T any](bucket *bucket[T], key string) *cacheDoc[T]
- func NewClient(url, pass string, dbIndex int, opts ...ClientOption) model.CacheClient
- func SetLogger(logger model.Logger)
- type ClientOption
Constants ¶
View Source
const ( CACHEDOC_KEY = "key" CACHEDOC_VAL = "val" CACHEDOC_LABELS = "labels" CACHEDOC_TS = "ts" )
Variables ¶
View Source
var Logger model.Logger = logger.NewDefaultLogger()
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 NewClient ¶
func NewClient(url, pass string, dbIndex int, opts ...ClientOption) model.CacheClient
Types ¶
type ClientOption ¶
type ClientOption func(*client)
func WithTimeout ¶
func WithTimeout(d time.Duration) ClientOption
Click to show internal directories.
Click to hide internal directories.