Documentation ¶
Overview ¶
This package implements a O(1) LFU Followed the origin paper http://dhruvbird.com/lfu.pdf
Index ¶
- type Cache
- func (c *Cache) Capacity() uint64
- func (c *Cache) Clear()
- func (c *Cache) Delete(key cache.Key)
- func (c *Cache) ElementsCount() uint64
- func (c *Cache) Evict(n int)
- func (c *Cache) Get(key cache.Key) (cache.Data, bool)
- func (c *Cache) Set(key cache.Key, data cache.Data)
- func (c *Cache) SetCapacity(capacity uint64)
- func (c *Cache) Size() uint64
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) ElementsCount ¶
func (*Cache) SetCapacity ¶
Click to show internal directories.
Click to hide internal directories.