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 ¶
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.
Click to show internal directories.
Click to hide internal directories.