cache

package
v0.0.0-...-4056b1e Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KEY

type KEY interface {
	~int64 | ~int | ~int32 | ~uint | ~uint32 | ~uint64 | string | float32
}

type LRUCache

type LRUCache[K KEY] struct {
	// contains filtered or unexported fields
}

func New

func New[K KEY](capacity int) *LRUCache[K]

func (*LRUCache[K]) Del

func (cache *LRUCache[K]) Del(key K) (any, bool)

func (*LRUCache[K]) Get

func (cache *LRUCache[K]) Get(key K) (any, bool)

func (*LRUCache[K]) Init

func (cache *LRUCache[K]) Init()

func (*LRUCache[K]) Print

func (cache *LRUCache[K]) Print()

func (*LRUCache[K]) Set

func (cache *LRUCache[K]) Set(key K, value any) (any, bool)

Jump to

Keyboard shortcuts

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