Documentation ¶
Overview ¶
Package memory is the memory implementation of the Trickster Cache and uses a sync.Map to manage cache objects
Index ¶
- 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) RetrieveReference(cacheKey string, allowExpired bool) (interface{}, 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
- func (c *Cache) StoreReference(cacheKey string, data cache.ReferenceObject, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Name string Config *options.Options Index *index.Index Logger *tl.Logger // contains filtered or unexported fields }
Cache defines a a Memory Cache client that conforms to the Cache interface
func (*Cache) BulkRemove ¶
BulkRemove removes a list of objects from the cache
func (*Cache) Close ¶
Close is not used for Cache, and is here to fully prototype the Cache Interface
func (*Cache) Configuration ¶
Configuration returns the Configuration for the Cache object
func (*Cache) Retrieve ¶
Retrieve looks for an object in cache and returns it (or an error if not found)
func (*Cache) RetrieveReference ¶
func (c *Cache) RetrieveReference(cacheKey string, allowExpired bool) (interface{}, status.LookupStatus, error)
RetrieveReference looks for an object in cache and returns it (or an error if not found)
func (*Cache) SetLocker ¶
func (c *Cache) SetLocker(l locks.NamedLocker)
SetLocker sets the cache's locker
func (*Cache) StoreReference ¶
func (c *Cache) StoreReference(cacheKey string, data cache.ReferenceObject, ttl time.Duration) error
StoreReference stores an object directly to the memory cache without requiring serialization