Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
NumCached metrics.Meter
NumTotal metrics.Meter
NumLoad metrics.Meter
NumLoadedBytes metrics.Meter
// contains filtered or unexported fields
}
Cache is a LRU piece cache of certain size. Items in the cache are expired after the defined TTL.
func (*Cache) Get ¶
Get item with the key from cache. If item is not in cache, load by calling `loader` func and put into the cache.
func (*Cache) LoadsActive ¶
LoadsActive returns the number of active Loader calls.
func (*Cache) LoadsWaiting ¶
LoadsWaiting returns the number of waiting Loader calls.
func (*Cache) Utilization ¶
Utilization is a number between 0 and 100 that returns the hit-ratio of the cache.
Click to show internal directories.
Click to hide internal directories.