Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Set(key string, value interface{}) error
Get(key string, dest interface{}) error
Delete(key string) error
}
func NewCache ¶
func NewCache(conf *CacheConfig) Cache
NewRedisCache creates a new RedisCache with a given TTL (time-to-live).
type CacheConfig ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
RedisCache struct defines the cache.
func (*RedisCache) Delete ¶
func (r *RedisCache) Delete(key string) error
Delete removes a cached value from Redis.
func (*RedisCache) Get ¶
func (r *RedisCache) Get(key string, dest interface{}) error
Get retrieves a cached value from Redis.
func (*RedisCache) Set ¶
func (r *RedisCache) Set(key string, value interface{}) error
Set caches a value in Redis.
type RedisCacheImpl ¶
type RedisCacheImpl struct {
// contains filtered or unexported fields
}
RedisCache struct defines the cache.
func (*RedisCacheImpl) Delete ¶
func (r *RedisCacheImpl) Delete(ctx context.Context, key string) error
Delete removes a cached value from Redis.
Click to show internal directories.
Click to hide internal directories.