Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ILru ¶
type ILru interface { Get(interface{}, NewLruElement) *Element // contains filtered or unexported methods }
type Lru ¶
type Lru struct {
// contains filtered or unexported fields
}
func (*Lru) Get ¶
func (r *Lru) Get(i interface{}, fn NewLruElement) *Element
Get 获取一个元素, 如果没有的话就用 NewLruElement 新建一个 如果已经超容量了, 就会触发清理, 将最近最少使用的元素移除(链表尾节点前移)
type NewLruElement ¶
type NewLruElement func(interface{}) *Element
Click to show internal directories.
Click to hide internal directories.