Directories
¶
| Path | Synopsis |
|---|---|
|
Command pvmon polls PV devices and serves the dashboard.
|
Command pvmon polls PV devices and serves the dashboard. |
|
Package docs embeds the API documentation: openapi.yaml and the Swagger UI build (docs/dist, built by `make docs`).
|
Package docs embeds the API documentation: openapi.yaml and the Swagger UI build (docs/dist, built by `make docs`). |
|
Package frontend embeds the built web UI (frontend/dist, built by `make assets`) into the binary.
|
Package frontend embeds the built web UI (frontend/dist, built by `make assets`) into the binary. |
|
internal
|
|
|
app
Package app is the composition root: it loads the configuration, maps it onto the Settings and Specs of every package and builds all components (Create* factories).
|
Package app is the composition root: it loads the configuration, maps it onto the Settings and Specs of every package and builds all components (Create* factories). |
|
auth
Package auth implements accounts, sessions, API tokens, the setup code, brute-force limits and the audit entries of these actions (spec 10).
|
Package auth implements accounts, sessions, API tokens, the setup code, brute-force limits and the audit entries of these actions (spec 10). |
|
buildinfo
Package buildinfo carries the version information set by the linker.
|
Package buildinfo carries the version information set by the linker. |
|
collector
Package collector polls the devices of one connection, normalises their values, turns counters into energy deltas, nets grid energy and books everything into 15-minute buckets (spec 5, 6).
|
Package collector polls the devices of one connection, normalises their values, turns counters into energy deltas, nets grid energy and books everything into 15-minute buckets (spec 5, 6). |
|
config
Package config loads the layered configuration (defaults → DB → file → env), decodes it into typed sections and validates its structure.
|
Package config loads the layered configuration (defaults → DB → file → env), decodes it into typed sections and validates its structure. |
|
configstore
Package configstore persists the UI configuration (spec 3): objects and settings with a revision (config_rev), history snapshots, audit entries with a diff, and encrypted secrets.
|
Package configstore persists the UI configuration (spec 3): objects and settings with a revision (config_rev), history snapshots, audit entries with a diff, and encrypted secrets. |
|
database
Package database opens the SQLite database, applies the embedded, versioned migrations (always after a verified backup) and makes verified online backups (spec 7.6).
|
Package database opens the SQLite database, applies the embedded, versioned migrations (always after a verified backup) and makes verified online backups (spec 7.6). |
|
derive
Package derive turns 15-minute buckets into periods (day, month, year, total) and site quantities, caching closed periods in derived_cache (spec 5.1 step 8, 7.3).
|
Package derive turns 15-minute buckets into periods (day, month, year, total) and site quantities, caching closed periods in derived_cache (spec 5.1 step 8, 7.3). |
|
eventbus
Package eventbus is the typed in-process event bus through which background components meet (AGENTS.md section 4).
|
Package eventbus is the typed in-process event bus through which background components meet (AGENTS.md section 4). |
|
health
Package health is the single supervisor: it starts restartable components, watches their state and heartbeat, restarts them within a budget and cancels the root context with ErrHealthFatal when that is no longer possible (spec 8.2).
|
Package health is the single supervisor: it starts restartable components, watches their state and heartbeat, restarts them within a budget and cancels the root context with ErrHealthFatal when that is no longer possible (spec 8.2). |
|
http/handler
Package handler holds the HTTP handlers; they contain no business logic and call services only.
|
Package handler holds the HTTP handlers; they contain no business logic and call services only. |
|
http/middleware
Package middleware holds HTTP middleware; handlers live in package handler.
|
Package middleware holds HTTP middleware; handlers live in package handler. |
|
http/router
Package router declares every HTTP route and its access level in one place.
|
Package router declares every HTTP route and its access level in one place. |
|
http/server
Package server runs the HTTP server lifecycle.
|
Package server runs the HTTP server lifecycle. |
|
livecache
Package livecache keeps the newest value per live key ("<meter>/<channel>") and publishes a change event for every new value.
|
Package livecache keeps the newest value per live key ("<meter>/<channel>") and publishes a change event for every new value. |
|
logging
Package logging builds the injected zerolog.Logger: JSON to stdout and, when a file is configured, additionally to a file rotated by timberjack.
|
Package logging builds the injected zerolog.Logger: JSON to stdout and, when a file is configured, additionally to a file rotated by timberjack. |
|
maintenance
Package maintenance holds the CLI jobs that run with the server stopped: the shared lock next to the database, dumps, backups, backfill, import and data correction (spec 13).
|
Package maintenance holds the CLI jobs that run with the server stopped: the shared lock next to the database, dumps, backups, backfill, import and data correction (spec 13). |
|
profile
Package profile holds the declarative device profiles (spec 4): schema, loader for built-in and local profiles, validation, decoder and status maps.
|
Package profile holds the declarative device profiles (spec 4): schema, loader for built-in and local profiles, validation, decoder and status maps. |
|
report
Package report is the pure energy report model (spec 12): complete days of the site quantities go in, sums, ratios, sections, patterns and key figures (with an optional comparison period) come out.
|
Package report is the pure energy report model (spec 12): complete days of the site quantities go in, sums, ratios, sections, patterns and key figures (with an optional comparison period) come out. |
|
report/csv
Package csv writes a report's buckets as CSV: one row per day, month or year with the site quantities and the derived columns (this app's estimates end in _est_kwh).
|
Package csv writes a report's buckets as CSV: one row per day, month or year with the site quantities and the derived columns (this app's estimates end in _est_kwh). |
|
report/pdf
Package pdf renders a report as an A4 PDF (spec 12): a summary page with key figures, energy charts and where the energy came from and went, the sections the site has (battery, PV sources, loadpoints, load profile), patterns, comparison and data quality, a compact table and a last page on how the report is calculated.
|
Package pdf renders a report as an A4 PDF (spec 12): a summary page with key figures, energy charts and where the energy came from and went, the sections the site has (battery, PV sources, loadpoints, load profile), patterns, comparison and data quality, a compact table and a last page on how the report is calculated. |
|
service
Package service holds the read services behind the HTTP handlers.
|
Package service holds the read services behind the HTTP handlers. |
|
simulate
Package simulate provides fake device sources for "pvmon simulate": a small, deterministic household model whose values are encoded through the real profiles, so the whole pipeline runs as with real devices (spec 13).
|
Package simulate provides fake device sources for "pvmon simulate": a small, deterministic household model whose values are encoded through the real profiles, so the whole pipeline runs as with real devices (spec 13). |
|
site
Package site builds the effective site model from configured connections, devices and meters plus their profiles: roles, categories, hierarchy, the series catalogue and the capabilities the UI is built from (spec 2, 3, 11).
|
Package site builds the effective site model from configured connections, devices and meters plus their profiles: roles, categories, hierarchy, the series catalogue and the capabilities the UI is built from (spec 2, 3, 11). |
|
sitecalc
Package sitecalc computes the live site quantities (spec 5.5) from the live cache: on a change of a meter value, debounced, and on a refresh tick so missing inputs remove the quantity.
|
Package sitecalc computes the live site quantities (spec 5.5) from the live cache: on a change of a meter value, debounced, and on a refresh tick so missing inputs remove the quantity. |
|
storage
Package storage is the sole owner of the SQLite database.
|
Package storage is the sole owner of the SQLite database. |
|
transport/http
Package http is the HTTP(S) JSON transport: GET requests only, basic and digest authentication, no redirects to other hosts, per-request timeouts and backoff after failures (spec 4.4, 10).
|
Package http is the HTTP(S) JSON transport: GET requests only, basic and digest authentication, no redirects to other hosts, per-request timeouts and backoff after failures (spec 4.4, 10). |
|
transport/modbus
Package modbus is the Modbus TCP/RTU transport: one shared connection with a FIFO request queue per address, raw register reads (FC 03/04 only), error classification and reconnect with exponential backoff.
|
Package modbus is the Modbus TCP/RTU transport: one shared connection with a FIFO request queue per address, raw register reads (FC 03/04 only), error classification and reconnect with exponential backoff. |
|
util
Package util holds small dependency-free helpers shared by all packages: the injected Clock, dependency checks, the Slot container and numeric helpers.
|
Package util holds small dependency-free helpers shared by all packages: the injected Clock, dependency checks, the Slot container and numeric helpers. |
|
util/clocktest
Package clocktest provides a manually driven util.Clock for tests: time only moves when the test calls Advance or Set, so polling, backoff and debounce run without sleeps.
|
Package clocktest provides a manually driven util.Clock for tests: time only moves when the test calls Advance or Set, so polling, backoff and debounce run without sleeps. |
|
ws
Package ws serves live values over WebSocket (spec 9.3): subscriptions per client, a per-client diff against what was sent, pushes coalesced into one frame per tick.
|
Package ws serves live values over WebSocket (spec 9.3): subscriptions per client, a per-client diff against what was sent, pushes coalesced into one frame per tick. |
|
Package profiles embeds the built-in device profiles into the binary (spec 4.5).
|
Package profiles embeds the built-in device profiles into the binary (spec 4.5). |
Click to show internal directories.
Click to hide internal directories.
