cache

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TTLCache

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

func NewTTLCache

func NewTTLCache[T comparable, V any](conf TTLConfig) *TTLCache[T, V]

func (*TTLCache[T, V]) Close

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

func (*TTLCache[T, V]) Get

func (c *TTLCache[T, V]) Get(item T) (V, bool)

func (*TTLCache[T, V]) Set

func (c *TTLCache[T, V]) Set(item T, v V)

func (*TTLCache[T, V]) StartGC

func (c *TTLCache[T, V]) StartGC()

type TTLConfig

type TTLConfig struct {
	ItemTTL  time.Duration
	GCConfig TTLGC
}

type TTLGC

type TTLGC struct {
	Enabled  bool
	Interval time.Duration
}

type TTLItem

type TTLItem[T any] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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