Discover Packages
github.com/rif/cache2go
package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Jan 29, 2018
License: BSD-3-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 6
Opens a new window with list of known importers.
README
README
¶
cache2go
Golang simple object caching library with LRU and expiration capabilities. The items are evicted if the capacity is exceeded or if they expire.
See the test file for wroking examples.
API docs here .
NOTE: For those looking for the alternate implementation please check the muesli branch or better track the muesli fork which is actively mentained (https://github.com/muesli/cache2go ).
Expand ▾
Collapse ▴
Documentation
¶
Cache is an LRU cache.
New creates a new Cache.
If maxEntries is zero, the cache has no limit and it's assumed
that eviction is done by the caller.
Remove removes the provided key from the cache.
Get looks up a key's value from the cache.
Len returns the number of items in the cache.
Add adds a value to the cache
Source Files
¶
Click to show internal directories.
Click to hide internal directories.