Documentation ¶
Overview ¶
Package cache provides generic cache. It is used to store values by key and retrieve them later.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache - generic cache implementation
func ContextCache ¶ added in v0.66.3
ContextCache returns cache from the context. If the cache is nil, it creates a new instance.
type ExpiringCache ¶
type ExpiringCache[V any] struct { Name string Cache map[string]ExpiringItem[V] Mutex *sync.RWMutex }
ExpiringCache - cache with items with expiration time
func NewExpiringCache ¶
func NewExpiringCache[V any](name string) *ExpiringCache[V]
NewExpiringCache - create new cache with generic type V
type ExpiringItem ¶
ExpiringItem - item with expiration time
Click to show internal directories.
Click to hide internal directories.