The highest tagged major version is
v5.
package
Version:
v4.2.2
Opens a new window with list of versions in this module.
Published: Feb 6, 2023
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
¶
Cache is a synchronised map of items that auto-expire once stale
NewCache is a helper to create instance of the Cache struct
func (cache *Cache) AddToSlice(key string, data interface{})
AddToSlice implements a super dirty slice cache method
Count returns the number of items in the cache
(helpful for tracking memory leaks)
Delete is a thread-safe way to delete items from the map
func (cache *Cache) Dump()
Dump is a thread-safe way to fully clear the cache
Get is a thread-safe way to lookup items
Every lookup, also touches the item, hence extending it's life
Set is a thread-safe way to add new items to the map
Item represents a record in the cache map
Source Files
¶
Click to show internal directories.
Click to hide internal directories.