lru

package
v0.0.0-...-931a278 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 1 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 {
	// contains filtered or unexported fields
}

func New

func New(capacity int) *Lru

func (*Lru) Get

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

func (*Lru) Put

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

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

func (*Lru) Size

func (lru *Lru) Size() int

Jump to

Keyboard shortcuts

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