cache

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 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 MemCache

type MemCache struct {
	// contains filtered or unexported fields
}

MemCache is a minimal TTL map[string] -> JSON object cache.

func NewMemCache

func NewMemCache() *MemCache

NewMemCache constructs an in-memory TTL cache.

func (*MemCache) Get

func (m *MemCache) Get(key string) (map[string]any, bool)

Get retrieves a cached value if not expired.

func (*MemCache) Set

func (m *MemCache) Set(key string, v map[string]any, ttl time.Duration)

Set stores a value with TTL.

Jump to

Keyboard shortcuts

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