Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewCache ¶
func NewCache(redis redis.Redis) *RedisCache
func NewTTLCache ¶
func NewTTLCache(redis redis.Redis, ttl time.Duration) *RedisCache
func (*RedisCache) Delete ¶
func (c *RedisCache) Delete(k string) error
func (*RedisCache) Get ¶
func (c *RedisCache) Get(k string) (interface{}, error)
func (*RedisCache) GetAll ¶ added in v0.11.0
func (c *RedisCache) GetAll() (map[string]interface{}, error)
func (*RedisCache) Put ¶
func (c *RedisCache) Put(k string, v interface{}) error
type RedisHashCache ¶ added in v0.11.0
type RedisHashCache struct {
// contains filtered or unexported fields
}
func NewHashCache ¶ added in v0.11.0
func NewHashCache(redis redis.Redis, key string) *RedisHashCache
func (*RedisHashCache) Delete ¶ added in v0.11.0
func (r *RedisHashCache) Delete(k string) error
func (*RedisHashCache) Get ¶ added in v0.11.0
func (r *RedisHashCache) Get(k string) (interface{}, error)
func (*RedisHashCache) GetAll ¶ added in v0.11.0
func (r *RedisHashCache) GetAll() (map[string]interface{}, error)
func (*RedisHashCache) Put ¶ added in v0.11.0
func (r *RedisHashCache) Put(k string, v interface{}) error
Put implementation for Putter interface. For TTLHashCache, Put acts mostly as normal Cache except it will check if the TTL for hashkey (not the key k), in case the TTL for hashkey is not yet existed or unset, EXPIRE will be called and set TTL time for the whole hashkey.
Click to show internal directories.
Click to hide internal directories.