Versions in this module Expand all Collapse all v1 v1.0.0 Nov 4, 2022 Changes in this version + type Cache struct + func New(interval time.Duration) *Cache + func (c Cache) Get(key interface{}) interface{} + func (c Cache) GetWithExpire(key interface{}) (payload interface{}, expired time.Time) + func (c Cache) Put(key interface{}, payload interface{}, ttl time.Duration) + type EvictCallback = func(key interface{}, value interface{}) + type LruCache struct + func NewLRUCache(options ...Option) *LruCache + func (c *LruCache) CloneTo(n *LruCache) + func (c *LruCache) Delete(key interface{}) + func (c *LruCache) Exist(key interface{}) bool + func (c *LruCache) Get(key interface{}) (interface{}, bool) + func (c *LruCache) GetWithExpire(key interface{}) (interface{}, time.Time, bool) + func (c *LruCache) Set(key interface{}, value interface{}) + func (c *LruCache) SetWithExpire(key interface{}, value interface{}, expires time.Time) + type Option func(*LruCache) + func WithAge(maxAge int64) Option + func WithEvict(cb EvictCallback) Option + func WithSize(maxSize int) Option + func WithStale(stale bool) Option + func WithUpdateAgeOnGet() Option