lru

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.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 LruCache

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

LruCache implements Cache by using memory

func NewLruCache

func NewLruCache(opts ...Option) *LruCache

func (*LruCache) Clear

func (mc *LruCache) Clear()

func (*LruCache) Delete

func (mc *LruCache) Delete(key string)

func (*LruCache) Get

func (mc *LruCache) Get(key string) (interface{}, bool)

func (*LruCache) Set

func (mc *LruCache) Set(key string, value interface{}, ttl time.Duration)

type Option

type Option func(*Options)

func MaxEntries

func MaxEntries(maxEntries int) Option

type Options

type Options struct {
	MaxEntries int
}

Jump to

Keyboard shortcuts

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