Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K, V comparable] struct { // contains filtered or unexported fields }
func New ¶
func New[K, V comparable](size int) (*Cache[K, V], error)
New creates the new Cache instance
func (*Cache[K, V]) SetCompareFn ¶
func (c *Cache[K, V]) SetCompareFn(compareFn CompareFn[V])
func (*Cache[K, V]) UpdateCacheValue ¶
func (c *Cache[K, V]) UpdateCacheValue(key K, newVal V) (updated bool)
UpdateCacheValue returns true if nev value updated in cache.
type CompareFn ¶
type CompareFn[V comparable] func(cacheVal, newVal V) bool
Click to show internal directories.
Click to hide internal directories.