MCPcopy Create free account
hub / github.com/golang/groupcache / Cache

Struct Cache

lru/lru.go:23–34  ·  view source on GitHub ↗

Cache is an LRU cache. It is not safe for concurrent access.

Source from the content-addressed store, hash-verified

21
22// Cache is an LRU cache. It is not safe for concurrent access.
23type Cache struct {
24 // MaxEntries is the maximum number of cache entries before
25 // an item is evicted. Zero means no limit.
26 MaxEntries int
27
28 // OnEvicted optionally specifies a callback function to be
29 // executed when an entry is purged from the cache.
30 OnEvicted func(key Key, value interface{})
31
32 ll *list.List
33 cache map[interface{}]*list.Element
34}
35
36// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators
37type Key interface{}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected