Discover Packages
github.com/jakima/dms
rrcache
package
Version:
v0.0.0-...-7b60772
Opens a new window with list of versions in this module.
Published: Aug 27, 2022
License: BSD-3-Clause
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package rrcache implements a random replacement cache. Items are set with
an associated size. When the capacity is exceeded, items will be randomly
evicted until it is not.
type Item struct {
Key, Value interface{}
}
func (c *RRCache ) Get(key interface{}) (value interface{}, ok bool )
Return all items currently in the cache. This is made available for
serialization purposes.
func (c *RRCache ) Set(key interface{}, value interface{}, size int64 )
Returns the sum size of all items currently in the cache.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.