cache

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*ttlCacheOptions)

func WithCleanupInterval

func WithCleanupInterval(interval time.Duration) Option

func WithMaxEntries

func WithMaxEntries(maxEntries int) Option

type TTLCache

type TTLCache[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewTTL

func NewTTL[K comparable, V any](opts ...Option) *TTLCache[K, V]

func (*TTLCache[K, V]) Clear

func (c *TTLCache[K, V]) Clear()

func (*TTLCache[K, V]) Close

func (c *TTLCache[K, V]) Close()

func (*TTLCache[K, V]) Get

func (c *TTLCache[K, V]) Get(key K) (V, bool)

func (*TTLCache[K, V]) Keys

func (c *TTLCache[K, V]) Keys() []K

func (*TTLCache[K, V]) Pop

func (c *TTLCache[K, V]) Pop(key K) (V, bool)

func (*TTLCache[K, V]) Remove

func (c *TTLCache[K, V]) Remove(key K)

func (*TTLCache[K, V]) Set

func (c *TTLCache[K, V]) Set(key K, value V, ttl time.Duration)

Jump to

Keyboard shortcuts

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