LRU

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallBack

type CallBack func(key interface{}, value interface{})

type Lru

type Lru struct {
	Call CallBack
	// contains filtered or unexported fields
}

func NewLru

func NewLru(len int, c CallBack) *Lru

func (*Lru) Add

func (l *Lru) Add(key interface{}, val interface{}) error

func (*Lru) Del

func (l *Lru) Del(key interface{})

func (*Lru) Get

func (l *Lru) Get(key interface{}) (val interface{}, ok bool)

func (*Lru) GetAll

func (l *Lru) GetAll() []*Node

type Node

type Node struct {
	Key interface{}
	Val interface{}
}

Jump to

Keyboard shortcuts

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