feat: add dependency shutdown and configurable service endpoints

This commit is contained in:
2026-09-24 18:33:24 +08:00
parent 8a348951eb
commit f0991d3ff2
51 changed files with 1433 additions and 73 deletions

View File

@@ -3,7 +3,14 @@
This checked-in example uses a relative local framework replacement (`../..`).
Run `go mod tidy && go run .` here. No external database or cloud account is required.
The Go-only error catalog is `internal/apierrors/catalog.go`, registered by svc.
The generated main and handlers are unmodified. Try:
The generated main and handlers are unmodified. Built-in endpoint switches and
paths are configured in etc/config.yaml under server.endpoints. Health replies
use the project envelope by default; responseMode: raw opts out. Readiness
failures stay HTTP 503, independently of business error status policies.
Dependencies can call svc.RequestShutdown(err); the generated entry drains
requests, closes resources and retains the failure for a nonzero exit.
Try:
```sh
curl -i 'http://127.0.0.1:8080/check?kind=fixed'