cache

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheTimeout  = 1 * time.Second
	CacheNotFound = errors.New("cache not found")
)

Functions

func DeleteCache

func DeleteCache(key string) error

func GetCache

func GetCache[T any](key string) (T, error)

func GetOrSetCache

func GetOrSetCache[T any](key string, expiration time.Duration, fn func() (T, error), timeout time.Duration) (T, error)

func InitCacheManager

func InitCacheManager()

func SetCache

func SetCache(key string, value any, expiration time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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