Documentation ¶ Index ¶ type LRU func NewLRU(maxSize int, onEvict func(key string, v interface{})) *LRU func (q *LRU) Add(key string, v interface{}) func (q *LRU) Clean(f func(key string, v interface{}) (remove bool)) (removed int) func (q *LRU) Del(key string) func (q *LRU) Get(key string) (interface{}, bool) func (q *LRU) Len() int func (q *LRU) PopOldest() (key string, v interface{}, ok bool) type LRULike Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type LRU ¶ type LRU struct { // contains filtered or unexported fields } func NewLRU ¶ func NewLRU(maxSize int, onEvict func(key string, v interface{})) *LRU func (*LRU) Add ¶ func (q *LRU) Add(key string, v interface{}) func (*LRU) Clean ¶ func (q *LRU) Clean(f func(key string, v interface{}) (remove bool)) (removed int) func (*LRU) Del ¶ func (q *LRU) Del(key string) func (*LRU) Get ¶ func (q *LRU) Get(key string) (interface{}, bool) func (*LRU) Len ¶ func (q *LRU) Len() int func (*LRU) PopOldest ¶ func (q *LRU) PopOldest() (key string, v interface{}, ok bool) type LRULike ¶ type LRULike interface { Add(key string, v interface{}) Del(key string) Clean(f func(key string, v interface{}) (remove bool)) (removed int) Get(key string) (v interface{}, ok bool) Len() int } Source Files ¶ View all Source files lru.go Click to show internal directories. Click to hide internal directories.