lru

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 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 LRU

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

func New

func New[K any, V any](size uint32) (lru *LRU[K, V])

func (*LRU[K, V]) Add

func (c *LRU[K, V]) Add(key K, value V) (evicted bool)

func (*LRU[K, V]) Get

func (c *LRU[K, V]) Get(key K) (value V, ok bool)

func (*LRU[K, V]) Keys

func (c *LRU[K, V]) Keys() []K

func (*LRU[K, V]) Len

func (c *LRU[K, V]) Len() int

func (*LRU[K, V]) Purge

func (c *LRU[K, V]) Purge()

func (*LRU[K, V]) Remove

func (c *LRU[K, V]) Remove(key K) (present bool)

func (*LRU[K, V]) Resize

func (c *LRU[K, V]) Resize(size int64) (evicted int64)

Jump to

Keyboard shortcuts

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