Versions in this module Expand all Collapse all v1 v1.0.2 Sep 1, 2026 v1.0.1 Sep 1, 2026 Changes in this version + const MsgItemNotFound + var ErrCacheInvalid = errors.New("cache is invalid") + var ErrCachingDisabled = errors.New("redis caching is disabled") + var ErrConfigNotSet = errors.New("configuration not initialized") + var ErrExpirationNotSet = errors.New("no default expiration set and no specific expiration provided") + var ErrItemNotFound = errors.New(MsgItemNotFound) + var ErrMutexExpirationNotSet = errors.New("no mutex expiration set for multiserver mode") + var ErrNoClientSet = errors.New("no redis client set in cache") + var ErrNoSuchIndexFound = errors.New("no such index found in cache") + func GuidToKey(id uuid.UUID) string + func NameToKey(name string) string + type RedisCache interface + AddItemToSet func(ctx context.Context, key string, item string) error + CreateIndex func(ctx context.Context, index string, options *redis.FTCreateOptions, ...) (string, error) + Delete func(ctx context.Context, key string) error + DeleteFlag func(ctx context.Context, key string) error + DeleteIndex func(ctx context.Context, index string, deleteDocuments bool) error + DeleteItemFromSet func(ctx context.Context, key string, item string) error + GetFlag func(ctx context.Context, key string) (bool, error) + GetItemsInSetAsMap func(ctx context.Context, key string) (map[string]struct{}, error) + Init func(config RedisCacheConfig, refreshFillerFunc func(ctx context.Context) error, ...) + IsItemInSet func(ctx context.Context, key string, item string) (bool, error) + IsValid func(ctx context.Context) bool + KeyForAll func() string + KeyForCustom func(customKey string) string + KeyForCustomPage func(page pagination.PaginatedQuery, customKey string) string + KeyForNotFound func() string + KeyForOne func(id uuid.UUID) string + KeyForPage func(page pagination.PaginatedQuery) string + KeyForValuedCustom func(name string, values ...string) string + Read func(ctx context.Context, key string, modelPtr interface{}) error + ReadGroup func(ctx context.Context, keys []string, modelArrayPtr interface{}) error + ReadWithExpiration func(ctx context.Context, key string, modelPtr interface{}, ...) error + RefreshCacheAsync func(ctx context.Context, forceUpdate bool) + SearchInIndex func(ctx context.Context, indexName string, queryString string, ...) (totalCount int, err error) + SetFlag func(ctx context.Context, key string) error + SetFlagWithExpiration func(ctx context.Context, key string, expirationTime *time.Duration) error + SetToInvalid func(ctx context.Context) + SetToValid func(ctx context.Context) + Store func(ctx context.Context, key string, content interface{}) error + StoreWithExpiration func(ctx context.Context, key string, content interface{}, ...) error + func NewRedisCache(redisClient *redis.Client, appName, cacheName string) RedisCache + type RedisCacheConfig struct + DefaultExpiration *time.Duration + IsDisabled bool + MultiserverMode bool + MutexExpiration *time.Duration + RefreshRetryAttempts int + RefreshRetryWaitExponent int + RefreshRetryWaitStartMs int