ttlstore

package
v0.0.0-...-602c0e8 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item[T any] struct {
	Value     T
	ExpiresAt time.Time
}

type Store

type Store[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](ttl time.Duration, maxEntries int, newID func() string) *Store[T]

func (*Store[T]) Delete

func (s *Store[T]) Delete(itemID string)

func (*Store[T]) Get

func (s *Store[T]) Get(itemID string) (T, bool)

func (*Store[T]) Set

func (s *Store[T]) Set(value T) string

func (*Store[T]) Update

func (s *Store[T]) Update(itemID string, fn func(*T) bool) bool

Jump to

Keyboard shortcuts

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