lru

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 2 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 {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLRU

func NewLRU(size int) *LRU

func (*LRU) Load

func (l *LRU) Load(key interface{}) (interface{}, bool)

func (*LRU) LoadOrPut

func (l *LRU) LoadOrPut(key interface{}, val interface{}) (interface{}, bool)

func (*LRU) Put

func (l *LRU) Put(key interface{}, val interface{})

func (*LRU) PutWithEvictCallback

func (l *LRU) PutWithEvictCallback(key interface{}, val interface{}, onEvict func(key interface{}, val interface{}))

func (*LRU) Remove

func (l *LRU) Remove(key interface{})

Jump to

Keyboard shortcuts

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