concurrent_lru

package
v4.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: GPL-3.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 ConcurrentLRU

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

func NewConcurrentLRU

func NewConcurrentLRU(
	shardNum, maxSizePerShard int,
	onEvict func(key string, v interface{}),
	onGet func(key string, v interface{}) interface{},
) *ConcurrentLRU

func (*ConcurrentLRU) Add

func (c *ConcurrentLRU) Add(key string, v interface{})

func (*ConcurrentLRU) Clean

func (c *ConcurrentLRU) Clean(f func(key string, v interface{}) (remove bool)) (removed int)

func (*ConcurrentLRU) Del

func (c *ConcurrentLRU) Del(key string)

func (*ConcurrentLRU) Get

func (c *ConcurrentLRU) Get(key string) (v interface{}, ok bool)

func (*ConcurrentLRU) Len

func (c *ConcurrentLRU) Len() int

Jump to

Keyboard shortcuts

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