Documentation
¶
Index ¶
- type Cache
- func (c *Cache) GetEntry(k string) Entry
- func (c *Cache) Len() int
- func (c *Cache) Misses() uint64
- func (c *Cache) MustStop()
- func (c *Cache) PutEntry(k string, e Entry)
- func (c *Cache) Requests() uint64
- func (c *Cache) Reset()
- func (c *Cache) Resets() uint64
- func (c *Cache) SizeBytes() uint64
- func (c *Cache) SizeMaxBytes() uint64
- type Entry
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 caches Entry entries.
Call NewCache() for creating new Cache.
func NewCache ¶
NewCache creates new cache.
Cache size in bytes is limited by the value returned by getMaxSizeBytes() callback. Call MustStop() in order to free up resources occupied by Cache.
func (*Cache) Misses ¶
Misses returns the number of cache misses for c since cache creation or last reset.
func (*Cache) Requests ¶
Requests returns the number of requests served by c since cache creation or last reset.
func (*Cache) Resets ¶ added in v1.110.25
Resets returns the number of cache resets since its creation.
func (*Cache) SizeBytes ¶
SizeBytes returns an approximate size in bytes of all the blocks stored in the cache c.
func (*Cache) SizeMaxBytes ¶
SizeMaxBytes returns the max allowed size in bytes for c.
Click to show internal directories.
Click to hide internal directories.