Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMetrics ¶ added in v0.3.2
func RegisterMetrics(namespace string)
Types ¶
type Cache ¶
type Cache[K, V comparable] struct { // contains filtered or unexported fields }
func New ¶
func New[K, V comparable](size int, opts ...Option[K, V]) (*Cache[K, V], error)
New creates the new Cache instance
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
type Option ¶ added in v0.3.2
type Option[K, V comparable] func(*Cache[K, V])
func WithCompareFunc ¶ added in v0.3.2
func WithCompareFunc[K, V comparable](compareFn CompareFn[V]) Option[K, V]
func WithMetrics ¶ added in v0.3.2
func WithMetrics[K, V comparable](instanceName string) Option[K, V]
Click to show internal directories.
Click to hide internal directories.