cache

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T any] interface {
	Add(key string, value *T) error
	Get(key string) (*T, error)
	Remove(key string)
}

func NewCache

func NewCache[T any]() Cache[T]

NewCache creates a new instance of Cache with a specified type. It initializes the cache with a default expiration time of 60 minutes and a cleanup interval of 10 minutes.

T: The type of the items to be stored in the cache.

Returns:

A new instance of Cache with the specified type.

Jump to

Keyboard shortcuts

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