docs(db-postgres): fix fictional launcher.Register/health.Register in doc examples #2
@@ -19,8 +19,9 @@
|
|||||||
import dbpg "code.nochebuena.dev/einherjar/db-postgres"
|
import dbpg "code.nochebuena.dev/einherjar/db-postgres"
|
||||||
|
|
||||||
db := dbpg.New(logger, dbpg.DefaultConfig())
|
db := dbpg.New(logger, dbpg.DefaultConfig())
|
||||||
launcher.Append(db) // OnInit opens pool; OnStop closes it
|
lc.Append(db) // OnInit opens pool; OnStop closes it
|
||||||
health.Register(db) // PING health check; LevelCritical
|
// db is observability.Checkable (PING health check, LevelCritical):
|
||||||
|
srv.Get("/health", health.NewHandler(logger, db).ServeHTTP)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Querying
|
### Querying
|
||||||
|
|||||||
@@ -13,8 +13,12 @@
|
|||||||
// # Lifecycle Registration
|
// # Lifecycle Registration
|
||||||
//
|
//
|
||||||
// db := postgres.New(logger, cfg)
|
// db := postgres.New(logger, cfg)
|
||||||
// launcher.Register(db)
|
// lc.Append(db) // lifecycle: OnInit → OnStart → OnStop
|
||||||
// health.Register(db)
|
//
|
||||||
|
// db satisfies [observability.Checkable], so it can back a health endpoint via
|
||||||
|
// web/health.NewHandler:
|
||||||
|
//
|
||||||
|
// srv.Get("/health", health.NewHandler(logger, db).ServeHTTP)
|
||||||
//
|
//
|
||||||
// # Querying
|
// # Querying
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user