docs(db-mysql): fix fictional launcher.Register/health.Register in doc examples
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.
This commit is contained in:
@@ -19,8 +19,9 @@
|
|||||||
import dbmysql "code.nochebuena.dev/einherjar/db-mysql"
|
import dbmysql "code.nochebuena.dev/einherjar/db-mysql"
|
||||||
|
|
||||||
db := dbmysql.New(logger, dbmysql.DefaultConfig())
|
db := dbmysql.New(logger, dbmysql.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
|
||||||
|
|||||||
@@ -14,8 +14,12 @@
|
|||||||
// # Lifecycle Registration
|
// # Lifecycle Registration
|
||||||
//
|
//
|
||||||
// db := mysql.New(logger, cfg)
|
// db := mysql.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