Documentation
¶
Overview ¶
Package cache contains cache implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LRU ¶
type LRU struct {
// contains filtered or unexported fields
}
LRU implements a fixed-size LRU cache with string keys. It can be used concurrently from multiple goroutines.
func (*LRU) Get ¶
Get returns the value associated with key. If the key isn't present in the map, nil and false are returned.
func (*LRU) TestAndSet ¶
TestAndSet saves a mapping from key to val and returns true if key isn't already present or if test returns true when passed the existing value. If test returns false, the mapping is not saved and false is returned. The new mapping is set unconditionally (and true is returned) if test is nil.
Click to show internal directories.
Click to hide internal directories.