Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, c *RedisStore, key string) error
Delete removes data by key from cache
func DeleteByStartsWith ¶
func DeleteByStartsWith(ctx context.Context, rs *RedisStore, key string) error
DeleteByStartsWith removes data with key starting with provided key from cache
Types ¶
type KVMap ¶
type KVMap[K comparable, V any] struct { // contains filtered or unexported fields }
KVMap represents map with arbitrary key and value types
type RedisClient ¶
type RedisClient interface {
GetStruct(ctx context.Context, key string, value any) error
SetStruct(ctx context.Context, key string, value any, ttl time.Duration) error
DeleteByMatch(ctx context.Context, pattern string) error
Delete(ctx context.Context, key string) error
}
RedisClient provides methods for working with redis
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore represents redis store
func NewRedisStore ¶
func NewRedisStore(redisClient RedisClient, log *zap.Logger) *RedisStore
NewRedisStore creates new Cache instance
Click to show internal directories.
Click to hide internal directories.