Documentation ¶
Overview ¶
Package redis is the redis implementation of the Trickster Cache and supports Standalone, Sentinel and Cluster
Index ¶
- Constants
- Variables
- type Cache
- func (c *Cache) BulkRemove(cacheKeys []string)
- func (c *Cache) Close() error
- func (c *Cache) Configuration() *options.Options
- func (c *Cache) Connect() error
- func (c *Cache) Locker() locks.NamedLocker
- func (c *Cache) Remove(cacheKey string)
- func (c *Cache) Retrieve(cacheKey string, allowExpired bool) ([]byte, status.LookupStatus, error)
- func (c *Cache) SetLocker(l locks.NamedLocker)
- func (c *Cache) SetTTL(cacheKey string, ttl time.Duration)
- func (c *Cache) Store(cacheKey string, data []byte, ttl time.Duration) error
Constants ¶
const Redis = "redis"
Redis is the string "redis"
Variables ¶
var ErrInvalidEndpointConfig = errors.New("invalid 'endpoint' config")
ErrInvalidEndpointConfig indicates an invalid endpoint config
var ErrInvalidEndpointsConfig = errors.New("invalid 'endpoints' config")
ErrInvalidEndpointsConfig indicates an invalid endpoints config
var ErrInvalidSentinalMasterConfig = errors.New("invalid 'sentinel_master' config")
ErrInvalidSentinalMasterConfig indicates an invalid sentinel_master config
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Name string Config *options.Options Logger *tl.Logger // contains filtered or unexported fields }
Cache represents a redis cache object that conforms to the Cache interface
func (*Cache) BulkRemove ¶
BulkRemove removes a list of objects from the cache. noLock is not used for Redis
func (*Cache) Configuration ¶
Configuration returns the Configuration for the Cache object
func (*Cache) Retrieve ¶
Retrieve gets data from the Redis Cache using the provided Key because Redis manages Object Expiration internally, allowExpired is not used.
func (*Cache) SetLocker ¶
func (c *Cache) SetLocker(l locks.NamedLocker)
SetLocker sets the cache's locker