Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCacheMiss = errors.New("cache miss")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[T any] interface { // Get returns the value for the given key. // If the key is not found, ErrCacheMiss is returned. Get(key string) (value T, err error) // Sets the value for the given key. Set(key string, value T) // Removes the key from the cache. Remove(key string) // Returns true if the key is found. Contains(key string) bool // Returns the number of items in the cache. Size() int // Removes all items from the cache. Clear() }
Click to show internal directories.
Click to hide internal directories.