timedcache

package
v0.0.0-...-4bf0284 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[K comparable, T any] struct {
	Duration time.Duration
	// contains filtered or unexported fields
}

func MakeCache

func MakeCache[K comparable, T any](duration time.Duration) *Cache[K, T]

func (*Cache[K, T]) Add

func (cache *Cache[K, T]) Add(key K, value T)

func (*Cache[K, T]) Contains

func (cache *Cache[K, T]) Contains(key K) bool

func (*Cache[K, T]) Get

func (cache *Cache[K, T]) Get(key K) (T, bool)

func (*Cache[K, T]) Remove

func (cache *Cache[K, T]) Remove(key K)

func (*Cache[K, T]) Size

func (cache *Cache[K, T]) Size() int

Jump to

Keyboard shortcuts

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