Documentation
¶
Overview ¶
Package goledger embeds repo-root release artifacts (the compiled book) so the server can serve them without copying the files into a package subtree. The embed directive can only reach files at or below its own directory, so this lives at the module root where the artifacts do.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LedgerBookPDF []byte
LedgerBookPDF is the compiled book, embedded from the repo root at build time. The landing page serves it inline so it opens in the browser's native PDF viewer instead of downloading. The ebook build regenerates the file; the next `go build` picks up the new bytes, so the served copy never drifts.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
genopenapi
command
Command genopenapi writes the OpenAPI spec to api/openapi.yaml.
|
Command genopenapi writes the OpenAPI spec to api/openapi.yaml. |
|
ledgerctl
command
Command ledgerctl is the operator CLI over the admin surface (Task 2.2b, audit A3.2/A2.3): onboarding a tenant and issuing/rotating/revoking its api keys with no raw SQL.
|
Command ledgerctl is the operator CLI over the admin surface (Task 2.2b, audit A3.2/A2.3): onboarding a tenant and issuing/rotating/revoking its api keys with no raw SQL. |
|
server
command
Command server runs the go-ledger HTTP API.
|
Command server runs the go-ledger HTTP API. |
|
verify-restore
command
Command verify-restore checks a restored ledger database against the ledger's own invariants (ADR-016, "Automated restore-and-verify").
|
Command verify-restore checks a restored ledger database against the ledger's own invariants (ADR-016, "Automated restore-and-verify"). |
|
examples
|
|
|
grpc-client
command
Command grpc-client is a small example that exercises the go-ledger gRPC API: it creates two accounts, posts a balanced transaction between them, and reads a balance back.
|
Command grpc-client is a small example that exercises the go-ledger gRPC API: it creates two accounts, posts a balanced transaction between them, and reads a balance back. |
|
internal
|
|
|
admin
Package admin is the operator-facing service behind the /v1/admin REST surface and the ledgerctl CLI (Task 2.2b, audit A3.2/A2.3): onboarding a tenant and issuing, rotating, or revoking its API keys, with no raw SQL.
|
Package admin is the operator-facing service behind the /v1/admin REST surface and the ledgerctl CLI (Task 2.2b, audit A3.2/A2.3): onboarding a tenant and issuing, rotating, or revoking its API keys, with no raw SQL. |
|
api
Package api defines the go-ledger HTTP API using huma, which generates the OpenAPI 3.1 spec directly from the typed operation handlers.
|
Package api defines the go-ledger HTTP API using huma, which generates the OpenAPI 3.1 spec directly from the typed operation handlers. |
|
audit
Package audit runs the single background chainer that builds each tenant's tamper-evident audit hash chain from the audit_outbox transactional outbox (ADR-017).
|
Package audit runs the single background chainer that builds each tenant's tamper-evident audit hash chain from the audit_outbox transactional outbox (ADR-017). |
|
auth
Package auth resolves a bearer API key to a domain.APIKey, backed by a short-TTL in-memory cache so the request hot path does not hit the database on every call.
|
Package auth resolves a bearer API key to a domain.APIKey, backed by a short-TTL in-memory cache so the request hot path does not hit the database on every call. |
|
crypto
Package crypto implements envelope encryption for posting descriptions (Task 6.2, audit A9.3): the technique that lets a data-subject erasure request destroy a tenant's ability to read its PII (free-text posting descriptions) WITHOUT mutating any money row or breaking the tamper-evident audit hash chain (ADR-012, ADR-017).
|
Package crypto implements envelope encryption for posting descriptions (Task 6.2, audit A9.3): the technique that lets a data-subject erasure request destroy a tenant's ability to read its PII (free-text posting descriptions) WITHOUT mutating any money row or breaking the tamper-evident audit hash chain (ADR-012, ADR-017). |
|
domain
Package domain holds the double-entry accounting model: Money, Account, Transaction, and Posting.
|
Package domain holds the double-entry accounting model: Money, Account, Transaction, and Posting. |
|
fx
Package fx resolves FX rates for cross-currency conversion (ADR-014) and seeds the append-only fx_rates table from the FX_RATES environment variable at boot.
|
Package fx resolves FX rates for cross-currency conversion (ADR-014) and seeds the append-only fx_rates table from the FX_RATES environment variable at boot. |
|
grpcserver
Package grpcserver is the gRPC adapter for the ledger.
|
Package grpcserver is the gRPC adapter for the ledger. |
|
ledger
Package ledger holds the application services that sit between transport (REST, gRPC) and the persistence port.
|
Package ledger holds the application services that sit between transport (REST, gRPC) and the persistence port. |
|
metrics
Package metrics holds the Prometheus collectors for the ledger and exposes an HTTP handler to scrape them.
|
Package metrics holds the Prometheus collectors for the ledger and exposes an HTTP handler to scrape them. |
|
observability
Package observability wires OpenTelemetry tracing and metrics for the ledger and correlates slog output with the active trace.
|
Package observability wires OpenTelemetry tracing and metrics for the ledger and correlates slog output with the active trace. |
|
opsmetrics
Package opsmetrics runs the periodic background collector that keeps internal/metrics's operational gauges (audit outbox backlog and lag, webhook delivery backlog, and the balance-invariant canary) fresh from the database (Task 5.6a, audit A6.1).
|
Package opsmetrics runs the periodic background collector that keeps internal/metrics's operational gauges (audit outbox backlog and lag, webhook delivery backlog, and the balance-invariant canary) fresh from the database (Task 5.6a, audit A6.1). |
|
paging
Package paging holds the shared keyset cursor used by both the REST and gRPC adapters to page account statements and audit logs, so the two protocols speak the identical opaque cursor format.
|
Package paging holds the shared keyset cursor used by both the REST and gRPC adapters to page account statements and audit logs, so the two protocols speak the identical opaque cursor format. |
|
postgres
Package postgres is the Postgres storage adapter for the ledger.
|
Package postgres is the Postgres storage adapter for the ledger. |
|
seed
Package seed populates the demo ledger with realistic, backdated data.
|
Package seed populates the demo ledger with realistic, backdated data. |
|
verify
Package verify checks a restored ledger database against the ledger's own invariants (ADR-016, "Automated restore-and-verify").
|
Package verify checks a restored ledger database against the ledger's own invariants (ADR-016, "Automated restore-and-verify"). |
|
web
Package web serves the embedded static landing page and its assets.
|
Package web serves the embedded static landing page and its assets. |
|
webhook
Package webhook runs the single background worker that fans posted transactions out to tenant-configured webhook subscribers, signs each delivery, and retries it with exponential backoff until it succeeds or is given up on as dead (Task 4.1, audit A7.1).
|
Package webhook runs the single background worker that fans posted transactions out to tenant-configured webhook subscribers, signs each delivery, and retries it with exponential backoff until it succeeds or is given up on as dead (Task 4.1, audit A7.1). |
Click to show internal directories.
Click to hide internal directories.