package mru
import "git.wntrmute.dev/kyle/go-mru"
Index ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
A Cache is a map that retains a limited number of items. It must be initialized with New, providing a maximum capacity for the cache. Only the most recently used items are retained.
func New ¶
New must be used to create a new Cache.
func (*Cache) ConsistencyCheck ¶
ConsistencyCheck runs a series of checks to ensure that the cache's data structures are consistent. It is not normally required, and it is primarily used in testing.
func (*Cache) Get ¶
Get returns the value stored in the cache. If the item isn't present, it will return false.
func (*Cache) Has ¶
Has returns true if the cache has an entry for k. It will not update the timestamp on the item.
func (*Cache) Len ¶
Len returns the number of items currently in the cache.
func (*Cache) Store ¶
Store adds the value v to the cache under the k.
Source Files ¶
mru.go timestamps.go
- Version
- v1.1.0 (latest)
- Published
- Aug 28, 2023
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 2 months ago –
Tools for package owners.