Documentation
¶
Overview ¶
Package catalogsummary owns the Motors "derived catalog summary" background worker. Every replica ticks, but only the one that wins a patterns.Mutex recomputes the summary (sqlc against the framework pool) and refreshes it in Valkey. GET /v1/catalog/summary then reads Valkey only — no Postgres on that path.
This is deliberately NOT a job platform — see VPQ-TO-GENERAL-JOB-QUEUE.md. It is "one replica should refresh this shared derived cache" (VALKEY-HEAVY).
Index ¶
- type Options
- type Refresher
- func (c *Refresher) GetDependencies() []string
- func (c *Refresher) GetInitOrderStage() cf.Stage
- func (c *Refresher) Init(ctx context.Context, fw *cf.CaerusFramework) error
- func (c *Refresher) Name() string
- func (c *Refresher) Run(ctx context.Context) error
- func (c *Refresher) Shutdown(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Interval between refresh attempts.
Interval time.Duration
// LockTTL bounds how long a replica may hold the refresh lock.
LockTTL time.Duration
// CacheTTL is how long the derived summary lives in Valkey.
CacheTTL time.Duration
}
Options are construction-time defaults.
type Refresher ¶
type Refresher struct {
// contains filtered or unexported fields
}
Refresher is the Caerus Motors catalog-summary refresher (a Runnable).
func (*Refresher) GetDependencies ¶
GetDependencies implements cf.Dependencies.
func (*Refresher) GetInitOrderStage ¶
GetInitOrderStage implements cf.CaerusComponent — data plane with postgres/valkey.
func (*Refresher) Init ¶
Init resolves peers and builds the sqlc query set against the framework pool.