Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvictCallback ¶
type EvictCallback func(key string, value interface{})
type LRU ¶
LRU cache with ttl
func NewLRU ¶
func NewLRU(size int, defaultTTL time.Duration, onEvict EvictCallback) *LRU
NewLRU returns a new LRU cache.
func (*LRU) Get ¶
Get returns the cached value index by key. Return an additional boolean value indicating whether the returned element is stale
Click to show internal directories.
Click to hide internal directories.