Documentation
¶
Overview ¶
Package cache holds the cache-aside decorators of storage ports. Valkey keeps what is read on every request and changes rarely; a decorator never answers differently from the port it wraps, only sooner.
Index ¶
Constants ¶
const TokenTTL = 30 * time.Second
TokenTTL bounds a cached row's life should a post-commit bump fail.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type None ¶
type None struct{}
None is the absent cache: every store answers directly.
func (None) Invalidate ¶ added in v0.0.18
Invalidate has nothing to drop.
type Tokens ¶
type Tokens struct {
// contains filtered or unexported fields
}
Tokens caches token lookups by digest. The cache key carries the account's token generation; every token mutation bumps it, so a revoked or regenerated token is never answered from the cache. Bearers are not cached: authentication always reads them live.
func NewTokens ¶
func NewTokens(client valkey.AsideClient, ttl time.Duration) Tokens
NewTokens builds the token cache over a cache-aside client.
func (Tokens) Invalidate ¶ added in v0.0.18
Invalidate starts a new token generation: a token written outside the decorated ports (the declared catalog) is never answered from the cache.