Versions in this module Expand all Collapse all v5 v5.33.2 Jul 13, 2021 v5.33.1 Jul 13, 2021 v5.33.0 Jul 13, 2021 Changes in this version + var ErrKeyNotFound = errors.New("key not found") + type Cache interface + Get func(key string, value interface{}) error + GetInvalidateClusterEvent func() string + Keys func() ([]string, error) + Len func() (int, error) + Name func() string + Purge func() error + Remove func(key string) error + Set func(key string, value interface{}) error + SetWithDefaultExpiry func(key string, value interface{}) error + SetWithExpiry func(key string, value interface{}, ttl time.Duration) error + func NewLRU(opts LRUOptions) Cache + func NewLRUStriped(opts LRUOptions) (Cache, error) + type CacheOptions struct + DefaultExpiry time.Duration + InvalidateClusterEvent string + Name string + Size int + Striped bool + StripedBuckets int + type LRU struct + func (l *LRU) Get(key string, value interface{}) error + func (l *LRU) GetInvalidateClusterEvent() string + func (l *LRU) Keys() ([]string, error) + func (l *LRU) Len() (int, error) + func (l *LRU) Name() string + func (l *LRU) Purge() error + func (l *LRU) Remove(key string) error + func (l *LRU) Set(key string, value interface{}) error + func (l *LRU) SetWithDefaultExpiry(key string, value interface{}) error + func (l *LRU) SetWithExpiry(key string, value interface{}, ttl time.Duration) error + type LRUOptions struct + DefaultExpiry time.Duration + InvalidateClusterEvent string + Name string + Size int + StripedBuckets int + type LRUStriped struct + func (L LRUStriped) Get(key string, value interface{}) error + func (L LRUStriped) GetInvalidateClusterEvent() string + func (L LRUStriped) Keys() ([]string, error) + func (L LRUStriped) Len() (int, error) + func (L LRUStriped) Name() string + func (L LRUStriped) Purge() error + func (L LRUStriped) Remove(key string) error + func (L LRUStriped) Set(key string, value interface{}) error + func (L LRUStriped) SetWithDefaultExpiry(key string, value interface{}) error + func (L LRUStriped) SetWithExpiry(key string, value interface{}, ttl time.Duration) error + type Provider interface + Close func() error + Connect func() error + NewCache func(opts *CacheOptions) (Cache, error) + func NewProvider() Provider