lru

package
v0.0.0-...-3a46f29 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 3 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
}

func NewLRUCache

func NewLRUCache(maxBytes int64, callback func(string, Value)) *Cache

func (*Cache) Delete

func (cache *Cache) Delete(key string) Value

删除

func (*Cache) Get

func (cache *Cache) Get(key string) (Value, bool)

查找

func (*Cache) GetEnd

func (cache *Cache) GetEnd() interface{}

func (*Cache) Set

func (cache *Cache) Set(key string, value Value)

设置(新增/更新)

type Value

type Value interface {
	Len() int64
}

Jump to

Keyboard shortcuts

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