- Go 96.3%
- Makefile 2.1%
- Dockerfile 1%
- Go Template 0.6%
| .forgejo/workflows | ||
| api | ||
| cmd/delivery-service | ||
| delivery-service@c2c566a851 | ||
| helm | ||
| internal | ||
| .dockerignore | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
delivery-service
The data layer of the bezorgdienst in Notificatie voor Burgers. It stores and returns what
delivery-process and delivery-management-process give and ask, and contains no business
logic: it delivers nothing, checks nothing and decides nothing. It follows the blauwe-knop layering:
delivery-process (logic) → delivery-service (data access) → delivery-db (schema and Postgres).
Internal only: never routed from outside the cluster. Every /v1 path except the specification
needs a service key (Authorization: Bearer <key>), one per calling process.
API
Dutch, as in api/openapi.yaml (OpenAPI 3.1, NL API Design Rules), served at /v1/openapi.json and /v1/openapi.yaml (both committed in api/, as in blauwe knop).
Every response carries API-Version; errors are application/problem+json.
PUT/GET/DELETE /v1/adressen/{functioneelAdres}: the technical address of a mailboxPUT/DELETE /v1/zendingen/{zendingReferentie},PUT …/poging,POST /v1/zendingen/_claim: zendingen taken on but not yet delivered; a claim hands each due zending to one caller only (FOR UPDATE SKIP LOCKED), and when to retry or return is decided by delivery-processGET/POST /v1/gebeurtenissen: the newest 200 eventsGET /v1/statistieken: registered mailboxes per host
What is stored: per functional address the technical address of its mailbox, and events with only the first eight characters of a functional address. No names, no BSN, never a sender or content: the bezorgdienst never receives the sender.
Configuration
DATABASE_URL: Postgres connection string (theurikey of the CloudNativePG app Secret ofdelivery-db)DELIVERY_PROCESS_API_KEY,DELIVERY_MANAGEMENT_PROCESS_API_KEY: the service keys of the two callersLISTEN_ADDRESS: defaults to:8080
Development
go test ./... # needs docker, or TEST_DATABASE_URL pointing at a Postgres server
golangci-lint run ./...
The store tests use internal/repositories/testdata/schema.sql, which mirrors the migrations of
delivery-db; change both together. With TEST_DATABASE_URL every test package creates a database
of its own on that server, so packages running in parallel never share tables.
CI
.forgejo/workflows/ci.yml tests against a Postgres service container, validates the spec with
Redocly and the ADR checker, lints the chart, and on main pushes
code.digitaledienst.overheid.nl/mijn-betaaloverzicht/delivery-service:<commit>.
Release
make release VERSION=1.2.3 # on an up-to-date main: writes helm/Chart.yaml, commits, tags v1.2.3
git push --follow-tags
The tag pipeline tags the image 1.2.3 and v1.2.3 and publishes the chart at 1.2.3 to the
Forgejo Helm registry (see the charts repository). The environments repository pins that
version.
License
EUPL-1.2, see LICENSE.