lru

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 1 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 cache

func NewCache

func NewCache(capacity int) Cache

NewCache new cache

func (*Cache) Get

func (lc *Cache) Get(key int) interface{}

Get get by key

func (*Cache) Put

func (lc *Cache) Put(key int, value interface{})

Put put value into cache

type Node

type Node struct {
	Key   int
	Value interface{}
	Prev  *Node
	Next  *Node
}

Node node

Jump to

Keyboard shortcuts

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