localcache

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoExpireDuration time.Duration = -1
)

Variables

This section is empty.

Functions

func New

func New[T any](opts ...Option) cache.Cache[T]

New creates a new localcache instance with optional configurations. It applies defaults if no options are provided.

Types

type Option

type Option func(*config)

func WithCleanupInterval

func WithCleanupInterval(interval time.Duration) Option

WithCleanupInterval sets the interval for automatically cleaning up expired items.

func WithDefaultExpiration

func WithDefaultExpiration(expiration time.Duration) Option

WithDefaultExpiration sets the default expiration duration for cache items.

Jump to

Keyboard shortcuts

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