ttlmap

package module
v0.0.0-...-327a2e5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 2 Imported by: 0

README

TTLMap map with expiring keys, keys expire after X amount of time from the time they were created or last accessed

Examples

Look into ttlmap_test.go

License

MIT Licence

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TTLMap

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

func New

func New[K comparable, T any](ln int, maxTTL int, closer func(val *item[T])) (m *TTLMap[K, T])

func (*TTLMap[K, T]) Get

func (m *TTLMap[K, T]) Get(k K) (v T, found bool)

func (*TTLMap[K, T]) Len

func (m *TTLMap[K, T]) Len() int

func (*TTLMap[K, T]) Put

func (m *TTLMap[K, T]) Put(k K, v T)

Jump to

Keyboard shortcuts

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