genericlru

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvictCallback

type EvictCallback[K any, V any] func(k K, v *V)

type GenericLRU

type GenericLRU[K any, V any] struct {
	// contains filtered or unexported fields
}

func NewGenericLRU

func NewGenericLRU[K any, V any](sz int, evict EvictCallback[K, V]) (*GenericLRU[K, V], error)

func (*GenericLRU[K, V]) Add

func (l *GenericLRU[K, V]) Add(k K, v *V) (evicted bool)

func (*GenericLRU[K, V]) Get

func (l *GenericLRU[K, V]) Get(k K) (*V, bool)

func (*GenericLRU[K, V]) Keys

func (l *GenericLRU[K, V]) Keys() (keys []K)

func (*GenericLRU[K, V]) Len

func (l *GenericLRU[K, V]) Len() int

func (*GenericLRU[K, V]) Remove

func (l *GenericLRU[K, V]) Remove(k K) (present bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL