Documentation ¶
Overview ¶
Package hotspotcache stores values like sync.Map does. Meanwhile, it handles a aging queue: every access to a existing object in the cache, it will be lifted up to he top of the queue and marked as the newest element. When the size in cache exceeds preset limit size, the bottom elements of the queue would be removed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is the hotspot cache object.
func New ¶
New returns a initialized cache with given size. When size of the cache exceeds maxSize, it will start cleaning.
Click to show internal directories.
Click to hide internal directories.