lru

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: LGPL-3.0 Imports: 2 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 struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

LRU - Least Recently Used cache

func New

func New(size int) *LRU

New LRU cache

func (*LRU) Get

func (c *LRU) Get(key interface{}) interface{}

Get an item from cache

func (*LRU) Has

func (c *LRU) Has(key interface{}) bool

Has check if an item exists in cache, without useness update

func (*LRU) Purge

func (c *LRU) Purge()

Purge cache

func (*LRU) Remove

func (c *LRU) Remove(key interface{})

Remove an item from cache

func (*LRU) Set

func (c *LRU) Set(key interface{}, value interface{})

Set an item to cache

Jump to

Keyboard shortcuts

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