Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { OnEvicted func(key string, value Value) // 某条记录被移除时的回调函数 // contains filtered or unexported fields }
Cache:创建结构体 方便实现后续的增改删查工作
func (*Cache) RemoveOldest ¶
func (c *Cache) RemoveOldest()
RemoveOldest :实现删除功能,根据LRU,移除最近最少访问节点即可,即移除队首元素即可
Click to show internal directories.
Click to hide internal directories.