Documentation ¶
Index ¶
- type LRU
- func (c *LRU) Clear()
- func (c *LRU) Contains(key interface{}) (ok bool)
- func (c *LRU) Del(key interface{}) bool
- func (c *LRU) DelOldest() (key, value interface{}, ok bool)
- func (c *LRU) Get(key interface{}) (interface{}, bool)
- func (c *LRU) GetOldest() (key, value interface{}, ok bool)
- func (c *LRU) GetWithOutUpdate(key interface{}) (interface{}, bool)
- func (c *LRU) Keys() []interface{}
- func (c *LRU) Len() int
- func (c *LRU) Resize(size int) (evicted int)
- func (c *LRU) Set(k, v interface{}) bool
- type PurgeCallback
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 New ¶
func New(size int, onPurge PurgeCallback) *LRU
func (*LRU) GetWithOutUpdate ¶
type PurgeCallback ¶
type PurgeCallback func(interface{}, interface{})
when the item is remove, it will call to tell the user
Click to show internal directories.
Click to hide internal directories.