expiremap

package
v0.0.0-...-407768f Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpireMap

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

func NewExpireMap

func NewExpireMap[K comparable, V any](hash func(K) uint32) *ExpireMap[K, V]

func (*ExpireMap[K, V]) Get

func (m *ExpireMap[K, V]) Get(key K) (*V, bool)

func (*ExpireMap[K, V]) PurgeExpired

func (m *ExpireMap[K, V]) PurgeExpired()

func (*ExpireMap[K, V]) SetIfAbsent

func (m *ExpireMap[K, V]) SetIfAbsent(key K, value V, ttl time.Duration) bool

SetIfAbsent sets the value for the key if it is not already present. Returns true if the value was set, false if it was already present.

Jump to

Keyboard shortcuts

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