Versions in this module Expand all Collapse all v0 v0.0.2 Feb 15, 2021 v0.0.1 May 18, 2019 Changes in this version + const TYPE_ARC + const TYPE_LFU + const TYPE_LRU + const TYPE_SIMPLE + var KeyNotFoundError = errors.New("Key not found.") + type ARC struct + func (c *ARC) Get(key interface{}) (interface{}, error) + func (c *ARC) GetALL(checkExpired bool) map[interface{}]interface{} + func (c *ARC) GetIFPresent(key interface{}) (interface{}, error) + func (c *ARC) Has(key interface{}) bool + func (c *ARC) Keys(checkExpired bool) []interface{} + func (c *ARC) Len(checkExpired bool) int + func (c *ARC) Purge() + func (c *ARC) Remove(key interface{}) bool + func (c *ARC) Set(key, value interface{}) error + func (c *ARC) SetWithExpire(key, value interface{}, expiration time.Duration) error + type AddedFunc func(interface{}, interface{}) + type Cache interface + Get func(key interface{}) (interface{}, error) + GetALL func(checkExpired bool) map[interface{}]interface{} + GetIFPresent func(key interface{}) (interface{}, error) + Has func(key interface{}) bool + Keys func(checkExpired bool) []interface{} + Len func(checkExpired bool) int + Purge func() + Remove func(key interface{}) bool + Set func(key, value interface{}) error + SetWithExpire func(key, value interface{}, expiration time.Duration) error + type CacheBuilder struct + func New(size int) *CacheBuilder + func (cb *CacheBuilder) ARC() *CacheBuilder + func (cb *CacheBuilder) AddedFunc(addedFunc AddedFunc) *CacheBuilder + func (cb *CacheBuilder) Build() Cache + func (cb *CacheBuilder) Clock(clock Clock) *CacheBuilder + func (cb *CacheBuilder) DeserializeFunc(deserializeFunc DeserializeFunc) *CacheBuilder + func (cb *CacheBuilder) EvictType(tp string) *CacheBuilder + func (cb *CacheBuilder) EvictedFunc(evictedFunc EvictedFunc) *CacheBuilder + func (cb *CacheBuilder) Expiration(expiration time.Duration) *CacheBuilder + func (cb *CacheBuilder) LFU() *CacheBuilder + func (cb *CacheBuilder) LRU() *CacheBuilder + func (cb *CacheBuilder) LoaderExpireFunc(loaderExpireFunc LoaderExpireFunc) *CacheBuilder + func (cb *CacheBuilder) LoaderFunc(loaderFunc LoaderFunc) *CacheBuilder + func (cb *CacheBuilder) PurgeVisitorFunc(purgeVisitorFunc PurgeVisitorFunc) *CacheBuilder + func (cb *CacheBuilder) SerializeFunc(serializeFunc SerializeFunc) *CacheBuilder + func (cb *CacheBuilder) Simple() *CacheBuilder + type Clock interface + Now func() time.Time + func NewRealClock() Clock + type DeserializeFunc func(interface{}, interface{}) (interface{}, error) + type EvictedFunc func(interface{}, interface{}) + type FakeClock interface + Advance func(d time.Duration) + func NewFakeClock() FakeClock + type Group struct + func (g *Group) Do(key interface{}, fn func() (interface{}, error), isWait bool) (interface{}, bool, error) + type LFUCache struct + func (c *LFUCache) Get(key interface{}) (interface{}, error) + func (c *LFUCache) GetALL(checkExpired bool) map[interface{}]interface{} + func (c *LFUCache) GetIFPresent(key interface{}) (interface{}, error) + func (c *LFUCache) Has(key interface{}) bool + func (c *LFUCache) Keys(checkExpired bool) []interface{} + func (c *LFUCache) Len(checkExpired bool) int + func (c *LFUCache) Purge() + func (c *LFUCache) Remove(key interface{}) bool + func (c *LFUCache) Set(key, value interface{}) error + func (c *LFUCache) SetWithExpire(key, value interface{}, expiration time.Duration) error + type LRUCache struct + func (c *LRUCache) Get(key interface{}) (interface{}, error) + func (c *LRUCache) GetALL(checkExpired bool) map[interface{}]interface{} + func (c *LRUCache) GetIFPresent(key interface{}) (interface{}, error) + func (c *LRUCache) Has(key interface{}) bool + func (c *LRUCache) Keys(checkExpired bool) []interface{} + func (c *LRUCache) Len(checkExpired bool) int + func (c *LRUCache) Purge() + func (c *LRUCache) Remove(key interface{}) bool + func (c *LRUCache) Set(key, value interface{}) error + func (c *LRUCache) SetWithExpire(key, value interface{}, expiration time.Duration) error + type LoaderExpireFunc func(interface{}) (interface{}, *time.Duration, error) + type LoaderFunc func(interface{}) (interface{}, error) + type PurgeVisitorFunc func(interface{}, interface{}) + type RealClock struct + func (rc RealClock) Now() time.Time + type SerializeFunc func(interface{}, interface{}) (interface{}, error) + type SimpleCache struct + func (c *SimpleCache) Get(key interface{}) (interface{}, error) + func (c *SimpleCache) GetALL(checkExpired bool) map[interface{}]interface{} + func (c *SimpleCache) GetIFPresent(key interface{}) (interface{}, error) + func (c *SimpleCache) Has(key interface{}) bool + func (c *SimpleCache) Keys(checkExpired bool) []interface{} + func (c *SimpleCache) Len(checkExpired bool) int + func (c *SimpleCache) Purge() + func (c *SimpleCache) Remove(key interface{}) bool + func (c *SimpleCache) Set(key, value interface{}) error + func (c *SimpleCache) SetWithExpire(key, value interface{}, expiration time.Duration) error