Documentation ¶
Index ¶
- type Cache
- func (cache *Cache) Delete(key string) error
- func (cache *Cache) Evict(percent float64)
- func (cache *Cache) Flush()
- func (cache *Cache) GetOrCreate(key string) (interface{}, error)
- func (cache *Cache) Len() int
- func (cache *Cache) Lookup(key string) (interface{}, bool)
- func (cache *Cache) Put(key string, val interface{})
- func (cache *Cache) Size() uint64
- func (cache *Cache) WriteBack()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { // Bytes serializes objects before they go into storage. Users are required to define this one Bytes func(k string, v interface{}) ([]byte, error) // FromBytes deserializes object coming from storage. Users are required to define this one FromBytes func(k string, v []byte) (interface{}, error) // New creates a new object when there's no object in cache or storage. Optional New func(k string) interface{} // contains filtered or unexported fields }
func (*Cache) Evict ¶ added in v0.0.33
Evict performs cache evictions. The difference between Evict and WriteBack is that evictions happen when cache grows above allowed threshold and write-back calls happen constantly, making pyroscope more crash-resilient. See https://github.com/pyroscope-io/pyroscope/issues/210 for more context
func (*Cache) GetOrCreate ¶ added in v0.0.37
Click to show internal directories.
Click to hide internal directories.