lever

package
v0.0.0-...-943df0e Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lever

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

func New

func New[K comparable, V any](size int, ttl time.Duration) *Lever[K, V]

func (*Lever[K, V]) Close

func (s *Lever[K, V]) Close()

func (*Lever[K, V]) Contains

func (s *Lever[K, V]) Contains(key K) (ok bool)

func (*Lever[K, V]) Get

func (s *Lever[K, V]) Get(key K) (value V, ok bool)

func (*Lever[K, V]) Len

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

func (*Lever[K, V]) Peek

func (s *Lever[K, V]) Peek(key K) (value V, ok bool)

func (*Lever[K, V]) Purge

func (s *Lever[K, V]) Purge()

func (*Lever[K, V]) Remove

func (s *Lever[K, V]) Remove(key K) (ok bool)

func (*Lever[K, V]) Set

func (s *Lever[K, V]) Set(key K, value V)

func (*Lever[K, V]) SetOnEvicted

func (s *Lever[K, V]) SetOnEvicted(callback types.OnEvictCallback[K, V])

Jump to

Keyboard shortcuts

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