Documentation ¶
Overview ¶
tlru (time aware least recently lastUsed) has the same overwriting strategy as LRU, but adds a lifetime to objects on creation. Objects whose lifetime is outdated, are considered dead and can be removed.
Index ¶
- type CacheItem
- type CacheList
- func (list *CacheList) Cap() uint
- func (list *CacheList) ClearHard()
- func (list *CacheList) ClearSoft()
- func (list *CacheList) ClearTableNils()
- func (list *CacheList) ClearTables()
- func (list *CacheList) CreateCacheableItem(content interface{}) interfaces.CacheableItem
- func (list *CacheList) Delete(id Snowflake)
- func (list *CacheList) Efficiency() float64
- func (list *CacheList) First() (item *CacheItem, key Snowflake)
- func (list *CacheList) Get(id Snowflake) (ret interfaces.CacheableItem, exists bool)
- func (list *CacheList) RefreshAfterDiscordUpdate(itemI interfaces.CacheableItem)
- func (list *CacheList) Set(id Snowflake, newItemI interfaces.CacheableItem)
- func (list *CacheList) Size() uint
- type Snowflake
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheItem ¶
type CacheItem struct {
// contains filtered or unexported fields
}
func NewCacheItem ¶
type CacheList ¶
func (*CacheList) ClearTableNils ¶ added in v0.8.4
func (list *CacheList) ClearTableNils()
func (*CacheList) ClearTables ¶ added in v0.8.4
func (list *CacheList) ClearTables()
func (*CacheList) CreateCacheableItem ¶
func (list *CacheList) CreateCacheableItem(content interface{}) interfaces.CacheableItem
func (*CacheList) Get ¶
func (list *CacheList) Get(id Snowflake) (ret interfaces.CacheableItem, exists bool)
get an item from the list.
func (*CacheList) RefreshAfterDiscordUpdate ¶
func (list *CacheList) RefreshAfterDiscordUpdate(itemI interfaces.CacheableItem)
func (*CacheList) Set ¶
func (list *CacheList) Set(id Snowflake, newItemI interfaces.CacheableItem)
set adds a new item to the list or returns false if the item already exists
Click to show internal directories.
Click to hide internal directories.