Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] struct { *lru.Cache[K, V] // contains filtered or unexported fields }
Cache is a wrapper around hashicorp lru but with metric for Get
func NewWithEvict ¶
type CacheWithTTL ¶
type CacheWithTTL[K comparable, V any] struct { *expirable.LRU[K, V] // contains filtered or unexported fields }
func NewWithTTL ¶
func NewWithTTL[K comparable, V any](metricName string, size int, ttl time.Duration) *CacheWithTTL[K, V]
func (*CacheWithTTL[K, V]) Get ¶
func (c *CacheWithTTL[K, V]) Get(k K) (V, bool)
Click to show internal directories.
Click to hide internal directories.