Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache - generic cache implementation
type ExpiringCache ¶
type ExpiringCache[V any] struct { Cache map[string]ExpiringItem[V] Mutex *sync.Mutex }
ExpiringCache - cache with items with expiration time
func NewExpiringCache ¶
func NewExpiringCache[V any]() *ExpiringCache[V]
NewExpiringCache - create new cache with generic type V
func (*ExpiringCache[V]) Get ¶
func (c *ExpiringCache[V]) Get(key string) (V, bool)
Get - fetch value from cache by key
type ExpiringItem ¶
ExpiringItem - item with expiration time
Click to show internal directories.
Click to hide internal directories.