Documentation ¶
Index ¶
- type Entry
- type PrioCache
- func (pc *PrioCache) Contains(key interface{}) bool
- func (pc *PrioCache) ForEach(cb func(*PrioEntry) bool) bool
- func (pc *PrioCache) Get(key interface{}) (interface{}, float64, bool)
- func (pc *PrioCache) Len() int
- func (pc *PrioCache) Remove(key interface{}) *PrioEntry
- func (pc *PrioCache) Set(key, value interface{}, priority float64)
- type PrioEntry
- type RandCache
- func (rc *RandCache) Contains(key interface{}) bool
- func (rc *RandCache) ForEach(cb func(*Entry) bool) bool
- func (rc *RandCache) Get(key interface{}) (interface{}, bool)
- func (rc *RandCache) Len() int
- func (rc *RandCache) Pick() *Entry
- func (rc *RandCache) Remove(key interface{}) bool
- func (rc *RandCache) Set(key, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrioCache ¶
type PrioCache struct {
// contains filtered or unexported fields
}
PrioCache a cache holds entries with priority. If len of cache reaches limit, the entry has lowest priority will be evicted.
type RandCache ¶
type RandCache struct {
// contains filtered or unexported fields
}
RandCache a simple cache which randomly evicts entries when length exceeds limit.
Click to show internal directories.
Click to hide internal directories.