Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheItemWithTTL ¶
type CacheWithItemTTL ¶
type CacheWithItemTTL[K comparable, V any] struct { *lru.Cache[K, CacheItemWithTTL[V]] // contains filtered or unexported fields }
CacheWithItemTTL is a cache that fetches items with an optional TTL if the TTL has been reached the item is fetched again, otherwise the item is returned from the cache
func NewCacheWithItemTTL ¶
func NewCacheWithItemTTL[K comparable, V any](size int, fetcher Fetcher[K, V], opts ...cacheOptionsFunc) (*CacheWithItemTTL[K, V], error)
Click to show internal directories.
Click to hide internal directories.