Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] interface { // Get - get data(Value) for Key (return Value if key doesn't expire) Get(K) (V, bool) // Set - set data(Value) for Key (without TTL, not expired) Set(K, V) // SetWithTTL - set data(Value) for Key (with TTL or when expired) SetWithTTL(K, V, TTL) // SetTTL - set TTL for Key SetTTL(K, TTL) // TryGetOrInvokeLambda - try Get(Key) if not found, exec Lambda and if success store Value by Set func TryGetOrInvokeLambda(K, lambda[K, V]) (V, error) // Delete - delete Key Delete(K) // CleanAll - delete all data in storage (all Key) CleanAll() }
Cache - interface of cache.
Click to show internal directories.
Click to hide internal directories.