sieve

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sieve

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

func New added in v0.1.3

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

func (*Sieve[K, V]) Close added in v1.0.0

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

func (*Sieve[K, V]) Contains

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

func (*Sieve[K, V]) Get

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

func (*Sieve[K, V]) Len

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

func (*Sieve[K, V]) Peek

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

func (*Sieve[K, V]) Purge added in v0.1.3

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

func (*Sieve[K, V]) Remove added in v0.1.4

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

func (*Sieve[K, V]) Set

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

func (*Sieve[K, V]) SetOnEvicted added in v1.0.0

func (s *Sieve[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