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

Struct cache

groupcache.go:400–406  ·  view source on GitHub ↗

cache is a wrapper around an *lru.Cache that adds synchronization, makes values always be ByteView, and counts the size of all keys and values.

Source from the content-addressed store, hash-verified

398// makes values always be ByteView, and counts the size of all keys and
399// values.
400type cache struct {
401 mu sync.RWMutex
402 nbytes int64 // of all keys and values
403 lru *lru.Cache
404 nhit, nget int64
405 nevict int64 // number of evictions
406}
407
408func (c *cache) stats() CacheStats {
409 c.mu.RLock()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected