1.7 KiB
Report Registry Internals
internal/report owns the in-process registry of report identities and the
resolution of a report's valid period. Command names and configuration aliases
belong to the CLI reference and configuration
reference, respectively.
Registry And Resolution
DefaultRegistry supplies the maintained definitions. Lookup returns a
definition by its internal ID, while Resolve combines it with a request time,
location, and optional date to produce Resolved. The result carries the
definition, generation time, timezone, and resolved valid period; its metadata
and output-name helpers keep derived identity values consistent for callers.
Definitions carry the internal collaborators needed downstream: prompt and template identity, module configuration, output naming, Distributor path templates, and fixed batch eligibility. The external prompt contract is owned by the Promptkit integration guide, template surface by the report template guide, and published Distributor paths by the Distributor bundle guide.
WithModuleOverrides returns an independently cloned registry with replacement
module configuration for recognized report IDs. The application owns batch
planning and data-dependent inclusion; see app orchestration
internals.
The registry never collects weather data, parses CLI flags, writes output, executes Promptkit, or delivers a report.
Verification
Focused tests protect retained report definitions, period resolution, Daily run-ID disambiguation, and rejection of retired command or configuration names:
go test ./internal/report