cache

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Overview

Package cache exposes the cache.Store interface and an in-process LRU default implementation used for Registry metadata caching and per-request permission-check caching.

See TAD §9.1 and PRD §33.2 for the full specification. Implemented in Phase 2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Get retrieves the value for key. Returns (value, true, nil) on hit,
	// (nil, false, nil) on miss, and (nil, false, err) on error.
	Get(ctx context.Context, key string) (val []byte, found bool, err error)
	// Set stores value under key with the given TTL. A zero TTL means
	// the entry never expires.
	Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
	// Delete removes the entry for key. Not found is not an error.
	Delete(ctx context.Context, key string) error
}

Store is the cache interface used throughout Orjanda. The in-process LRU default is provided by NewLRUStore. A Redis-backed Store is a drop-in replacement for horizontal scaling. See TAD §9.1 and PRD §33.2.

func NewLRUStore

func NewLRUStore(maxItems int) Store

NewLRUStore creates an in-process LRU cache with the given maximum entry count. When the store is full, the least-recently-used entry is evicted.

Jump to

Keyboard shortcuts

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