lfu

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 LFU

type LFU struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

LFU - Least Frequently Used cache

func New

func New(size int) *LFU

New LFU cache

func (*LFU) Get

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

Get an item from cache

func (*LFU) Has

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

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

func (*LFU) Purge

func (c *LFU) Purge()

Purge cache

func (*LFU) Remove

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

Remove an item from cache

func (*LFU) Set

func (c *LFU) 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