Documentation ¶
Overview ¶
Package ttlru LRU with TTL, implemented with 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 NewTTL ¶
func NewTTL(contex context.Context, size int) (*LruWithTTL, error)
NewTTL creates an LRU of the given size
func NewTTLWithEvict ¶
func NewTTLWithEvict(context context.Context, 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
Click to show internal directories.
Click to hide internal directories.