lru

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const COMPACTION_INTERVAL = 5 * time.Second

Duration between times when we clear out all old data from the memory cache.

Variables

This section is empty.

Functions

This section is empty.

Types

type LruCache

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

func New

func New(maxEntries int) (*LruCache, error)

func (*LruCache) Close

func (l *LruCache) Close()

func (*LruCache) Flush

func (l *LruCache) Flush() error

func (*LruCache) Insert

func (l *LruCache) Insert(key string, value []byte, ttl time.Duration) error

func (*LruCache) Len

func (l *LruCache) Len() uint

func (*LruCache) Retrieve

func (l *LruCache) Retrieve(key string) ([]byte, error)

func (*LruCache) Size

func (l *LruCache) Size() uint64

Jump to

Keyboard shortcuts

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