lrucache

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: LGPL-3.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 Cache

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

func NewCache

func NewCache[K comparable, V any](size int) *Cache[K, V]

func (*Cache[K, V]) Contains

func (c *Cache[K, V]) Contains(key K) bool

Contains checks if a key is in the cache, without updating the recent-ness or deleting it for being stale.

func (*Cache[K, V]) Get

func (c *Cache[K, V]) Get(key K) (V, bool)

func (*Cache[K, V]) Keys

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

func (*Cache[K, V]) Len

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

func (*Cache[K, V]) Set

func (c *Cache[K, V]) Set(key K, value V)

Jump to

Keyboard shortcuts

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