allkeyslfu

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PolicyName      string = "allkeyslfu"
	DefaultCapacity int    = 10_000
	MinimumCapacity int    = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[K comparable, V any](capacity int) *Store[K, V]

func (*Store[K, V]) Add

func (s *Store[K, V]) Add(key K, item data.Item[K, V])

func (*Store[K, V]) Flush

func (s *Store[K, V]) Flush()

func (*Store[K, V]) Get

func (s *Store[K, V]) Get(key K) (data.Item[K, V], bool)

func (*Store[K, V]) Items

func (s *Store[K, V]) Items() map[K]data.Item[K, V]

func (*Store[K, V]) Keys

func (s *Store[K, V]) Keys() []K

func (*Store[K, V]) Len

func (s *Store[K, V]) Len() int

func (*Store[K, V]) RandomKey

func (s *Store[K, V]) RandomKey() (K, bool)

func (*Store[K, V]) Remove

func (s *Store[K, V]) Remove(keys ...K)

Jump to

Keyboard shortcuts

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