lrucache

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry[K cmp.Ordered, V any] struct {
	Key   K
	Value V
}

type FastConcurrentLRUCache

type FastConcurrentLRUCache[K cmp.Ordered, V any] struct {
	// contains filtered or unexported fields
}

func (*FastConcurrentLRUCache[K, V]) Capacity

func (c *FastConcurrentLRUCache[K, V]) Capacity() int

func (*FastConcurrentLRUCache[K, V]) Get

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

func (*FastConcurrentLRUCache[K, V]) Put

func (c *FastConcurrentLRUCache[K, V]) Put(key K, value V)

type FastSingleThreadLRUCache

type FastSingleThreadLRUCache[K cmp.Ordered, V any] struct {
	// contains filtered or unexported fields
}

func (*FastSingleThreadLRUCache[K, V]) Capacity

func (c *FastSingleThreadLRUCache[K, V]) Capacity() int

func (*FastSingleThreadLRUCache[K, V]) Get

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

func (*FastSingleThreadLRUCache[K, V]) Put

func (c *FastSingleThreadLRUCache[K, V]) Put(key K, value V)

type LRUCache

type LRUCache[K cmp.Ordered, V any] interface {
	Capacity() int
	Get(key K) (V, bool)
	Put(key K, value V)
}

func NewFastConcurrentLRUCache

func NewFastConcurrentLRUCache[K cmp.Ordered, V any](capacity int) LRUCache[K, V]

func NewFastSingleThreadLRUCache

func NewFastSingleThreadLRUCache[K cmp.Ordered, V any](capacity int) LRUCache[K, V]

Jump to

Keyboard shortcuts

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