Documentation ¶
Index ¶
- type Cache
- func (c Cache) Clear(key string)
- func (c Cache) Get(key string) (io.Reader, bool)
- func (c Cache) GetCompressed(key string) (io.Reader, bool)
- func (c Cache) RefreshTTL(key string, expiration time.Duration)
- func (c Cache) Set(key string, data []byte, expiration time.Duration)
- func (c Cache) SetCompressed(key string, data []byte, expiration time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a rudimentary key/value caching store backed by redis. It offers a Get/Set interface as well a its gzip compressed alternative GetCompressed/SetCompressed
func New ¶
func New(client redis.UniversalClient) Cache
New returns a new Cache from a potentially nil redis client.
func (Cache) Get ¶
Get fetch the cached asset at the given key, and returns true only if the asset was found.
func (Cache) GetCompressed ¶
GetCompressed works like Get but expect a compressed asset that is uncompressed.
func (Cache) RefreshTTL ¶
RefreshTTL can be used to update the TTL of an existing entry in the cache.
Click to show internal directories.
Click to hide internal directories.