package
Version:
v0.0.5
Opens a new window with list of versions in this module.
Published: Feb 20, 2025
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Cache[T any] struct {
}
Cache represents an in-memory cache.
NewCache creates a new instance of the cache.
Get retrieves an item from the cache by its key.
func (c *Cache[T]) Reset()
Set adds an item to the cache with a specified key and expiration time.
type CacheItem[T any] struct {
Value T
Expiration time.Time
}
CacheItem represents an item stored in the cache.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.