Documentation
¶
Overview ¶
Package cache implements a cache. The cache hold 256 shards, each shard holds a cache: a map with a mutex. There is no fancy expunge algorithm, it just randomly evicts elements when it gets full.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is cache.
func (*Cache) Add ¶
Add adds a new element to the cache. If the element already exists it is overwritten. Returns true if an existing element was evicted to make room for this element.