Documentation
¶
Overview ¶
Package cache implements a REDIS cache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(key string) (interface{}, error) Set(key string, value interface{}) error GetJSON(key string, value interface{}) error SetJSON(key string, value interface{}) error }
func NewRedisCache ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) Get ¶
func (rc *RedisCache) Get(key string) (interface{}, error)
Get retrieves a value from the cache.
func (*RedisCache) GetJSON ¶
func (rc *RedisCache) GetJSON(key string, value interface{}) error
GetJSON retrieves a JSON string and unmarshals it into the given interface.
func (*RedisCache) Set ¶
func (rc *RedisCache) Set(key string, value interface{}) error
Set stores a value in the cache.
func (*RedisCache) SetJSON ¶
func (rc *RedisCache) SetJSON(key string, value interface{}) error
SetJSON stores a struct as a JSON string.
Click to show internal directories.
Click to hide internal directories.