Documentation ¶
Overview ¶
Package lttlru LRU with TTL, implemented without goroutine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LruWithTTL ¶
LruWithTTL lru with ttl
func NewTTLWithEvict ¶
func NewTTLWithEvict(size int, onEvicted func(key interface{}, value interface{})) (*LruWithTTL, error)
NewTTLWithEvict creates an LRU of the given size and a evict callback function
func (*LruWithTTL) AddWithTTL ¶
func (lru *LruWithTTL) AddWithTTL(key, value interface{}, ttl time.Duration) bool
AddWithTTL add an key:val with TTL
func (*LruWithTTL) GetWithTTL ¶
func (lru *LruWithTTL) GetWithTTL(key interface{}) (interface{}, bool)
Click to show internal directories.
Click to hide internal directories.