Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ICache ¶
type ICache[K comparable, V any] interface { Set(key K, value V, ttl ...time.Duration) Get(key K) (V, bool) Remove(key K) Pop(key K) (V, bool) }
ICache defines the methods for a generic key-value cache.
type TTLCache ¶
type TTLCache[K comparable, V any] struct { // contains filtered or unexported fields }
TTLCache is a generic in-memory key-value cache with optional TTL support.
Click to show internal directories.
Click to hide internal directories.