lrucache

package
v5.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 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 Cache

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

Cache is an LRU cache.

func New

func New(maxLen int) *Cache

New creates a new LRU Cache.

func (*Cache) Get

func (c *Cache) Get(key string) (interface{}, bool)

Get looks up a key's value from the cache.

func (*Cache) Set

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

Set adds a new value or promote the existing value in the cache.

Jump to

Keyboard shortcuts

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