Versions in this module Expand all Collapse all v0 v0.2.2 Jan 18, 2026 v0.2.0 Jan 18, 2026 Changes in this version + type Cache struct + func NewCacheWithMetrics[T any](rc *redis.Client, key string, collector metrics.CacheMetricsCollector, ...) *Cache[T] + func NewCache[T any](rc *redis.Client, key string, useHash ...bool) *Cache[T] + func (c *Cache[T]) Delete(ctx context.Context, field string) error + func (c *Cache[T]) Exists(ctx context.Context, field string) (bool, error) + func (c *Cache[T]) Expire(ctx context.Context, field string, expiration time.Duration) error + func (c *Cache[T]) Get(ctx context.Context, field string) (*T, error) + func (c *Cache[T]) GetArray(ctx context.Context, field string, dest any) error + func (c *Cache[T]) GetMultiple(ctx context.Context, fields []string) (map[string]*T, error) + func (c *Cache[T]) Key(field string) string + func (c *Cache[T]) Set(ctx context.Context, field string, data *T, expire ...time.Duration) error + func (c *Cache[T]) SetArray(ctx context.Context, field string, data any, expire ...time.Duration) error + func (c *Cache[T]) SetMultiple(ctx context.Context, items map[string]*T, expire ...time.Duration) error + func (c *Cache[T]) TTL(ctx context.Context, field string) (time.Duration, error) + type ICache interface + Delete func(context.Context, string) error + Exists func(context.Context, string) (bool, error) + Expire func(context.Context, string, time.Duration) error + Get func(context.Context, string) (*T, error) + GetArray func(context.Context, string, any) error + GetMultiple func(context.Context, []string) (map[string]*T, error) + Set func(context.Context, string, *T, ...time.Duration) error + SetArray func(context.Context, string, any, ...time.Duration) error + SetMultiple func(context.Context, map[string]*T, ...time.Duration) error + TTL func(context.Context, string) (time.Duration, error)