Documentation
¶
Overview ¶
Package local is a bounded in-process cache.Store, for development, tests and single-process deployments. It is per process: another instance has its own, and a restart empties it.
It never grows past its limits. When it is full it first drops entries that have already expired, then the least recently used. There is no background goroutine and nothing to start or stop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// MaxEntries is the most entries held. It must be positive.
MaxEntries int
// MaxBytes, when positive, is the most bytes held, counting each entry's
// full key plus its value. Zero means no byte budget; negative is
// invalid.
MaxBytes int64
// Now is the clock; nil means time.Now. Tests set it to control expiry.
Now func() time.Time
}
Config bounds a Store. MaxEntries is required.
Click to show internal directories.
Click to hide internal directories.