Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addr string `mapstructure:"addr"` Password string `mapstructure:"password"` DB int `mapstructure:"db"` TTL time.Duration `mapstructure:"ttl"` }
Config struct for Redis configuration
type RedisCache ¶
type RedisCache[T any] struct { // contains filtered or unexported fields }
RedisCache struct implementing ICache interface
func NewRedisCache ¶
func NewRedisCache[T any](config *Config, logger logger.ILogger) *RedisCache[T]
NewRedisCache returns a new RedisCache with provided config
func (*RedisCache[T]) Get ¶
func (r *RedisCache[T]) Get(key interface{}) (T, bool)
Get method retrieves value by key from Redis
func (*RedisCache[T]) Set ¶
func (r *RedisCache[T]) Set(key interface{}, val T) bool
Set method stores key-value pair in Redis with TTL
Click to show internal directories.
Click to hide internal directories.