Versions in this module Expand all Collapse all v2 v2.9.1 Nov 16, 2021 Changes in this version + const ItemExpireWithGlobalTTL + const ItemNotExpire + var ErrClosed = errors.New("cache already closed") + var ErrNotFound = errors.New("key not found") + type Cache struct + func NewCache() *Cache + func (cache *Cache) Close() error + func (cache *Cache) Count() int + func (cache *Cache) Flush() + func (cache *Cache) Get(key string) (interface{}, error) + func (cache *Cache) Purge() error + func (cache *Cache) Remove(key string) error + func (cache *Cache) Set(key string, data interface{}) error + func (cache *Cache) SetCheckExpirationCallback(callback CheckExpireCallback) + func (cache *Cache) SetExpirationCallback(callback ExpireCallback) + func (cache *Cache) SetLoaderFunction(loader LoaderFunction) + func (cache *Cache) SetNewItemCallback(callback ExpireCallback) + func (cache *Cache) SetTTL(ttl time.Duration) error + func (cache *Cache) SetWithTTL(key string, data interface{}, ttl time.Duration) error + func (cache *Cache) SkipTTLExtensionOnHit(value bool) + type CheckExpireCallback func(key string, value interface{}) bool + type ExpireCallback func(key string, value interface{}) + type LoaderFunction func(key string) (data interface{}, ttl time.Duration, err error) Other modules containing this package github.com/Velocidex/ttlcache