lru

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package lru implements a lru cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func New

func New(onEvicted func(string, any)) *Cache

func (*Cache) Add

func (c *Cache) Add(key string, value any)

Add adds or just updates an entry.

func (*Cache) Get

func (c *Cache) Get(key string) (value any, ok bool)

func (*Cache) Len

func (c *Cache) Len() int

func (*Cache) Remove added in v1.7.2

func (c *Cache) Remove(key string)

func (*Cache) RemoveOldest

func (c *Cache) RemoveOldest()

Jump to

Keyboard shortcuts

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