lru

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lru added in v0.19.0

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

func New

func New(capacity int) *Lru

func (*Lru) Get added in v0.19.0

func (lru *Lru) Get(k interface{}) (v interface{}, exist bool)

func (*Lru) Put added in v0.19.0

func (lru *Lru) Put(k interface{}, v interface{}) bool

注意: 1. 无论插入前,元素是否已经存在,插入后,元素都会存在于Lru容器中 2. 插入元素时,也会更新热度(不管插入前元素是否已经存在) @return 插入前元素已经存在则返回false

func (*Lru) Size added in v0.19.0

func (lru *Lru) Size() int

Jump to

Keyboard shortcuts

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