Documentation ¶
Overview ¶
package core defines some core function to a cache ,and provides a lru implement
package core defines a goroutines unsafely core cache implements
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { // optional and executed when an entry is purged. OnEvicted func(key string, value interface{}) // contains filtered or unexported fields }
Cache is a LRU cache. It is not safe for concurrent access.
func NewLRUCache ¶
NewLRUCache returns a pointer to a lru cache maxBytes: max usage memory size onEvicted: after func call when keys evicted
Click to show internal directories.
Click to hide internal directories.