Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSlice ¶ added in v1.3.0
type ByteSlice struct {
// contains filtered or unexported fields
}
type CosterLRU ¶ added in v1.3.10
type CosterLRU[K comparable, V Coster] struct { // contains filtered or unexported fields }
func MakeCosterLRU ¶ added in v1.3.10
func MakeCosterLRU[K comparable, V Coster](cap int) CosterLRU[K, V]
func NewCosterLRU ¶ added in v1.3.10
func NewCosterLRU[K comparable, V Coster](cap int) *CosterLRU[K, V]
type CosterRandom ¶ added in v1.3.13
type CosterRandom[K comparable, V Coster] struct { // contains filtered or unexported fields }
CosterRandom is a key value cache with random eviction. The cache holds key values under cost cap and evicts random items if the cache holds cache items beyond the cost cap.
func MakeCosterRandom ¶ added in v1.3.13
func MakeCosterRandom[K comparable, V Coster](cap int, src rand.Source) CosterRandom[K, V]
MakeCosterRandom returns a new CosterRandom object.
func NewCosterRandom ¶ added in v1.3.13
func NewCosterRandom[K comparable, V Coster](cap int, src rand.Source) *CosterRandom[K, V]
func (*CosterRandom[K, V]) Get ¶ added in v1.3.13
func (c *CosterRandom[K, V]) Get(key K) (val V, ok bool)
func (*CosterRandom[K, V]) Put ¶ added in v1.3.13
func (c *CosterRandom[K, V]) Put(key K, value V)
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
func NewLRUCache ¶
type SimpleCache ¶ added in v0.9.7
type SimpleCache struct {
// contains filtered or unexported fields
}
func NewSimpleCache ¶ added in v0.9.7
func NewSimpleCache(cap int) *SimpleCache
func (*SimpleCache) Get ¶ added in v0.9.7
func (c *SimpleCache) Get(key []byte) interface{}
func (*SimpleCache) Put ¶ added in v0.9.7
func (c *SimpleCache) Put(key []byte, value interface{})
Click to show internal directories.
Click to hide internal directories.