memory

package
v0.0.0-...-8885390 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIntervalStore

func NewIntervalStore(cfg IntervalStoreConfig) *intervalStore

NewIntervalStore return a namespaced cache.Store that is backed in memory and refreshes its states at a regular interval.

func NewLRUStore

func NewLRUStore(cfg LRUStoreConfig) *lruStore

NewLRUStore return a namespaced cache.Store that is backed in memory.

func NewTTLStore

func NewTTLStore(cfg TTLStoreConfig) *ttlStore

NewTTLStore return a namespaced cache.Store that is backed in memory

Types

type IntervalStoreConfig

type IntervalStoreConfig struct {
	// Capacity sets the maximum cache items allowed in the cache store, least-recent
	// used items will get removed when capacity is reached.
	Capacity int

	CleanupInterval time.Duration
}

IntervalStoreConfig captures configs for NewLRUStore

type LRUStoreConfig

type LRUStoreConfig struct {
	// Capacity sets the maximum cache items allowed in the cache store, least-recent
	// used items will get removed when capacity is reached.
	Capacity int
}

LRUStoreConfig captures configs for NewLRUStore

type TTLStoreConfig

type TTLStoreConfig struct {
	DefaultExpiration, CleanupInterval time.Duration
}

TTLStoreConfig captures configs for ttlStore

Jump to

Keyboard shortcuts

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