Documentation
¶
Overview ¶
Package nestcore is the shared infrastructure module behind Nestova and Nestorage. It holds platform concerns only — configuration, database access, HTTP serving, rendering, caching, crypto, metrics — and never domain code.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bootstrap handles first-run detection and persistence of the runtime configuration that must exist before the database does.
|
Package bootstrap handles first-run detection and persistence of the runtime configuration that must exist before the database does. |
|
Package cache provides a small Cache port for data that is derived, re-computable, or externally sourced — an external API response, a normalized/aggregated read that is expensive to recompute but never the sole source of truth for it.
|
Package cache provides a small Cache port for data that is derived, re-computable, or externally sourced — an external API response, a normalized/aggregated read that is expensive to recompute but never the sole source of truth for it. |
|
Package config loads and validates runtime configuration from the environment, one sub-config at a time.
|
Package config loads and validates runtime configuration from the environment, one sub-config at a time. |
|
Package crypto provides password hashing and verification using the argon2id algorithm.
|
Package crypto provides password hashing and verification using the argon2id algorithm. |
|
cryptotest
Package cryptotest provides test-only helpers for the crypto package, following the convention of the standard library's httptest.
|
Package cryptotest provides test-only helpers for the crypto package, following the convention of the standard library's httptest. |
|
Package db provides Postgres connectivity for the application: a pooled connection built from configuration and a health check used for readiness.
|
Package db provides Postgres connectivity for the application: a pooled connection built from configuration and a health check used for readiness. |
|
dbtest
Package dbtest provides the shared harness for database-gated tests.
|
Package dbtest provides the shared harness for database-gated tests. |
|
migrate
Package migrate runs database schema migrations with goose over the pgx stdlib driver (a database/sql handle, distinct from an application's pgxpool).
|
Package migrate runs database schema migrations with goose over the pgx stdlib driver (a database/sql handle, distinct from an application's pgxpool). |
|
Package httpserver wires the HTTP transport: the router, the core middleware chain, and the server lifecycle.
|
Package httpserver wires the HTTP transport: the router, the core middleware chain, and the server lifecycle. |
|
middleware
Package middleware provides composable net/http middleware for the request backbone: request IDs, structured logging, panic recovery, and per-request timeouts.
|
Package middleware provides composable net/http middleware for the request backbone: request IDs, structured logging, panic recovery, and per-request timeouts. |
|
identity
|
|
|
adapter
Package adapter contains the identity bounded context's outbound adapters: pgx-backed implementations of the ports declared in identity/domain, run against the schema identity/migrate owns.
|
Package adapter contains the identity bounded context's outbound adapters: pgx-backed implementations of the ports declared in identity/domain, run against the schema identity/migrate owns. |
|
app
Package app contains the identity context's application services.
|
Package app contains the identity context's application services. |
|
domain
Package domain holds the identity bounded context's entities, value objects, and ports (interfaces): Household, Member with the unified owner/adult/child Role vocabulary, and Credential — the password half of a member's login.
|
Package domain holds the identity bounded context's entities, value objects, and ports (interfaces): Household, Member with the unified owner/adult/child Role vocabulary, and Credential — the password half of a member's login. |
|
migrate
Package migrate owns nestcore's identity schema: household, member (with its unified owner/adult/child role vocabulary and IDENTITY-level active flag), the MFA/recovery-code/WebAuthn credential tables, and the shared sessions table that gives Nestova and Nestorage one login (epic NSTR-112).
|
Package migrate owns nestcore's identity schema: household, member (with its unified owner/adult/child role vocabulary and IDENTITY-level active flag), the MFA/recovery-code/WebAuthn credential tables, and the shared sessions table that gives Nestova and Nestorage one login (epic NSTR-112). |
|
Package metrics owns the caller's Prometheus instrumentation: the registry (with the standard process/runtime collectors), the HTTP request metrics observed by the middleware layer, and the background scheduler tick metrics recorded through the TickRecorder port.
|
Package metrics owns the caller's Prometheus instrumentation: the registry (with the standard process/runtime collectors), the HTTP request metrics observed by the middleware layer, and the background scheduler tick metrics recorded through the TickRecorder port. |
|
Package qrcode is a thin platform seam over a QR-encoding library, mirroring the render package: it renders a QR code entirely server-side and returns it as a self-contained "data:image/png;base64,..." URI, so callers (Templ components) embed it directly in an <img src> with no client-side QR JS and no extra HTTP round trip to fetch the image.
|
Package qrcode is a thin platform seam over a QR-encoding library, mirroring the render package: it renders a QR code entirely server-side and returns it as a self-contained "data:image/png;base64,..." URI, so callers (Templ components) embed it directly in an <img src> with no client-side QR JS and no extra HTTP round trip to fetch the image. |
|
Package render is the HTTP rendering seam for templ components.
|
Package render is the HTTP rendering seam for templ components. |
|
Package totp is a thin platform seam over github.com/pquerna/otp (RFC 6238 TOTP), mirroring the qrcode and crypto packages: it isolates the third-party dependency behind a small, stateless surface so the caller's application layer depends on its own minimal interface rather than the library directly, keeping that layer's tests hermetic and the library swappable.
|
Package totp is a thin platform seam over github.com/pquerna/otp (RFC 6238 TOTP), mirroring the qrcode and crypto packages: it isolates the third-party dependency behind a small, stateless surface so the caller's application layer depends on its own minimal interface rather than the library directly, keeping that layer's tests hermetic and the library swappable. |
Click to show internal directories.
Click to hide internal directories.