Documentation ¶
Overview ¶
Package cache provides methods and structs for caching data
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Has returns true if cache contains data for given key Has(key string) bool // Size returns number of items in cache Size() int // Expired returns number of expired items in cache Expired() int // Set adds or updates item in cache Set(key string, data any, expiration ...time.Duration) bool // GetWithExpiration returns item from cache Get(key string) any // GetWithExpiration returns item expiration date GetExpiration(key string) time.Time // GetWithExpiration returns item from cache and expiration date or nil GetWithExpiration(key string) (any, time.Time) // Delete removes item from cache Delete(key string) bool // Flush removes all data from cache Flush() bool }
Cache is cache backend interface
Click to show internal directories.
Click to hide internal directories.