Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache []*cacheShard
type LRUExpireCache ¶
type LRUExpireCache struct {
// contains filtered or unexported fields
}
func NewLRUExpireCache ¶
func NewLRUExpireCache(maxSize int) *LRUExpireCache
NewLRUExpireCache creates an expiring cache with the given size
func NewLRUExpireCacheWithClock ¶
func NewLRUExpireCacheWithClock(maxSize int, clock Clock) *LRUExpireCache
NewLRUExpireCache creates an expiring cache with the given size, using the specified clock to obtain the current time
func (*LRUExpireCache) Add ¶
func (c *LRUExpireCache) Add(key lru.Key, value interface{}, ttl time.Duration)
func (*LRUExpireCache) SetOnEvictedFunc ¶
func (c *LRUExpireCache) SetOnEvictedFunc(evictedFunc func(key lru.Key, value interface{}))
Click to show internal directories.
Click to hide internal directories.