docs(db-postgres): fix fictional launcher.Register/health.Register in doc examples (#2)

The package-doc examples showed a fictional launcher.Register / health.Register
API (and launcher.Append as a package func). Corrected to the real wiring:
lc.Append + web/health.NewHandler(...).ServeHTTP.

Documentation-only. No code, API, or dependency changes; version stays v1.1.0
(the v1.1.0 tag is moved to include this fix). Verified by compiling the
corrected pattern against the real API.

Reviewed-on: #2
Co-authored-by: Rene Nochebuena Guerrero <rene@nochebuena.dev>
Co-committed-by: Rene Nochebuena Guerrero <rene@nochebuena.dev>
This commit was merged in pull request #2.
This commit is contained in:
2026-08-07 22:21:06 -06:00
committed by NOCHEBUENADEV
parent fe3e0227d5
commit 64ebf76f31
2 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -19,8 +19,9 @@
import dbpg "code.nochebuena.dev/einherjar/db-postgres"
db := dbpg.New(logger, dbpg.DefaultConfig())
launcher.Append(db) // OnInit opens pool; OnStop closes it
health.Register(db) // PING health check; LevelCritical
lc.Append(db) // OnInit opens pool; OnStop closes it
// db is observability.Checkable (PING health check, LevelCritical):
srv.Get("/health", health.NewHandler(logger, db).ServeHTTP)
```
### Querying
+6 -2
View File
@@ -13,8 +13,12 @@
// # Lifecycle Registration
//
// db := postgres.New(logger, cfg)
// launcher.Register(db)
// health.Register(db)
// lc.Append(db) // lifecycle: OnInit → OnStart → OnStop
//
// db satisfies [observability.Checkable], so it can back a health endpoint via
// web/health.NewHandler:
//
// srv.Get("/health", health.NewHandler(logger, db).ServeHTTP)
//
// # Querying
//