cache

package
v0.0.0-...-ba76322 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.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 {
	Lookup   map[string]*list.Element
	Queue    *list.List
	Capacity int
}

func New

func New(capacity int) *LRU

func (*LRU) Add

func (l *LRU) Add(key string, val int)

Upsert

func (*LRU) Get

func (l *LRU) Get(key string) (int, error)

func (*LRU) RemoveOldest

func (l *LRU) RemoveOldest()

func (*LRU) Update

func (l *LRU) Update(node Node)

type Node

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

Jump to

Keyboard shortcuts

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