Documentation
¶
Index ¶
- type CacheWrapper
- func (w *CacheWrapper) Clear()
- func (w *CacheWrapper) CountQueries() int64
- func (w *CacheWrapper) Delete(key string)
- func (w *CacheWrapper) Get(key string) ([]byte, bool)
- func (w *CacheWrapper) GetMaxMemorySize() int64
- func (w *CacheWrapper) GetMemoryUsage() int64
- func (w *CacheWrapper) Set(key string, value []byte, ttl time.Duration)
- type RedisClientConfig
- type RedisConfig
- func (c *RedisConfig) Clear() error
- func (c *RedisConfig) CountQueries() (int64, error)
- func (c *RedisConfig) CountQueriesWithPattern(pattern string) (int, error)
- func (c *RedisConfig) Delete(key string) error
- func (c *RedisConfig) Get(key string) ([]byte, bool, error)
- func (c *RedisConfig) GetMaxMemorySize() int64
- func (c *RedisConfig) GetMemoryUsage() int64
- func (c *RedisConfig) Set(key string, value []byte, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheWrapper ¶ added in v0.29.1
type CacheWrapper struct {
// contains filtered or unexported fields
}
CacheWrapper wraps RedisConfig to implement the CacheClient interface without returning errors, for backward compatibility
func NewCacheWrapper ¶ added in v0.29.1
func NewCacheWrapper(config *RedisConfig, logger *libpack_logger.Logger) *CacheWrapper
NewCacheWrapper creates a new cache wrapper
func (*CacheWrapper) CountQueries ¶ added in v0.29.1
func (w *CacheWrapper) CountQueries() int64
CountQueries returns the number of queries
func (*CacheWrapper) Delete ¶ added in v0.29.1
func (w *CacheWrapper) Delete(key string)
Delete removes a key
func (*CacheWrapper) Get ¶ added in v0.29.1
func (w *CacheWrapper) Get(key string) ([]byte, bool)
Get retrieves a value
func (*CacheWrapper) GetMaxMemorySize ¶ added in v0.29.1
func (w *CacheWrapper) GetMaxMemorySize() int64
GetMaxMemorySize returns 0 for Redis (not applicable)
func (*CacheWrapper) GetMemoryUsage ¶ added in v0.29.1
func (w *CacheWrapper) GetMemoryUsage() int64
GetMemoryUsage returns 0 for Redis (not applicable)
type RedisClientConfig ¶
type RedisConfig ¶
type RedisConfig struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.18.7
func New(redisClientConfig *RedisClientConfig) (*RedisConfig, error)
func (*RedisConfig) Clear ¶
func (c *RedisConfig) Clear() error
func (*RedisConfig) CountQueries ¶
func (c *RedisConfig) CountQueries() (int64, error)
func (*RedisConfig) CountQueriesWithPattern ¶
func (c *RedisConfig) CountQueriesWithPattern(pattern string) (int, error)
func (*RedisConfig) Delete ¶
func (c *RedisConfig) Delete(key string) error
func (*RedisConfig) GetMaxMemorySize ¶ added in v0.29.1
func (c *RedisConfig) GetMaxMemorySize() int64
GetMaxMemorySize returns the configured max memory for Redis In Redis, this would be the 'maxmemory' configuration value
func (*RedisConfig) GetMemoryUsage ¶ added in v0.29.1
func (c *RedisConfig) GetMemoryUsage() int64
GetMemoryUsage returns an approximation of memory usage for Redis For Redis, this is not as accurate as the memory cache implementation as actual memory is managed by Redis server