cache

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpiringCache

type ExpiringCache[T any] interface {
	// Put adds the value to the cache unter the passed key with expiration. If expiration <=0, entry will NOT be cached
	Put(key string, val *T, expiration time.Duration)

	// Get returns the value of cached entry with remained TTL. If entry is not cached, returns nil
	Get(key string) (val *T, expiration time.Duration)

	// TotalCount returns the total count of valid (not expired) elements
	TotalCount() int

	// Clear removes all cache entries
	Clear()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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