Versions in this module Expand all Collapse all v1 v1.0.1 Jan 30, 2026 v1.0.0 Jan 28, 2026 Changes in this version + var NoHostProvidedErr error = errors.New("no host provided") + var RedisModeHa = RedisMode("ha") + var RedisModeStandalone = RedisMode("standalone") + func DefaultRedisClient() *redis.Client + func NewEncodedCache[T any](cache cache.CacheInterface[string], transcoder BinaryTranscoder[T], ...) cache.CacheInterface[T] + func NewTransparentRedisCache[T any](redisClient *redis.Client, transcoder BinaryTranscoder[T], ttl time.Duration) cache.CacheInterface[T] + func RedisClient(config RedisClientConfig) (*redis.Client, error) + type BinaryTranscoder interface + Decode func([]byte) (T, error) + Encode func(T) ([]byte, error) + type Cache struct + func NewInMemoryCache[T any](ttl time.Duration, garbageCollectionRate time.Duration) *Cache[T] + func NewRedisCache[T CplnCacheEntry](ttl time.Duration, redisClient *redis.Client) *Cache[T] + type CacheInterface interface + type CollectionCache interface + Clear func(ctx context.Context) error + Delete func(ctx context.Context, name string) error + DeleteMany func(ctx context.Context, names []string) error + Exists func(ctx context.Context, name string) (bool, error) + Get func(ctx context.Context, name string) (*T, error) + IsValid func(ctx context.Context) (bool, error) + ListAll func(ctx context.Context) ([]*T, error) + MarkValid func(ctx context.Context, ttl time.Duration) error + Set func(ctx context.Context, item *T) error + SetMany func(ctx context.Context, items []*T) error + func NewRedisCollectionCache[T any](config RedisClientConfig, batchSize int, prefix string, ...) (CollectionCache[T], error) + type CplnCacheEntry interface + type CplnRedisStore struct + func (c *CplnRedisStore[T]) Clear(ctx context.Context) error + func (c *CplnRedisStore[T]) Delete(ctx context.Context, key any) error + func (c *CplnRedisStore[T]) Get(ctx context.Context, key any) (any, error) + func (c *CplnRedisStore[T]) GetType() string + func (c *CplnRedisStore[T]) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error) + func (c *CplnRedisStore[T]) Invalidate(ctx context.Context, options ...store.InvalidateOption) error + func (c *CplnRedisStore[T]) Set(ctx context.Context, key any, value any, options ...store.Option) error + type EncodedCache struct + func (r *EncodedCache[T]) Clear(ctx context.Context) error + func (r *EncodedCache[T]) Delete(ctx context.Context, key any) error + func (r *EncodedCache[T]) Get(ctx context.Context, key any) (T, error) + func (r *EncodedCache[T]) GetType() string + func (r *EncodedCache[T]) Invalidate(ctx context.Context, options ...store.InvalidateOption) error + func (r *EncodedCache[T]) Set(ctx context.Context, key any, object T, options ...store.Option) error + type JsonCplnCacheEntry struct + func NewJsonCplnCacheEntry[T any](payload T) *JsonCplnCacheEntry[T] + func (a *JsonCplnCacheEntry[T]) MarshalBinary() (data []byte, err error) + func (a *JsonCplnCacheEntry[T]) Payload() T + func (a *JsonCplnCacheEntry[T]) UnmarshalBinary(data []byte) error + type JsonTranscoder struct + func (j JsonTranscoder[T]) Decode(bytes []byte) (T, error) + func (j JsonTranscoder[T]) Encode(t T) ([]byte, error) + type RedisClientConfig struct + Hosts []string + MasterName string + MaxRetries int + Mode RedisMode + Password string + type RedisCollectionCache struct + func (c *RedisCollectionCache[T]) Clear(ctx context.Context) error + func (c *RedisCollectionCache[T]) Delete(ctx context.Context, name string) error + func (c *RedisCollectionCache[T]) DeleteMany(ctx context.Context, names []string) error + func (c *RedisCollectionCache[T]) Exists(ctx context.Context, name string) (bool, error) + func (c *RedisCollectionCache[T]) Get(ctx context.Context, name string) (*T, error) + func (c *RedisCollectionCache[T]) IsValid(ctx context.Context) (bool, error) + func (c *RedisCollectionCache[T]) ListAll(ctx context.Context) ([]*T, error) + func (c *RedisCollectionCache[T]) MarkValid(ctx context.Context, ttl time.Duration) error + func (c *RedisCollectionCache[T]) Set(ctx context.Context, item *T) error + func (c *RedisCollectionCache[T]) SetMany(ctx context.Context, items []*T) error + type RedisMode string