From 71593ad685402430085e208ed5d2d80bdf3a9d28 Mon Sep 17 00:00:00 2001 From: Rene Nochebuena Guerrero Date: Fri, 7 Aug 2026 22:20:42 -0600 Subject: [PATCH] docs(db-mysql): 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: https://code.nochebuena.dev/einherjar/db-mysql/pulls/2 Co-authored-by: Rene Nochebuena Guerrero Co-committed-by: Rene Nochebuena Guerrero --- README.md | 5 +++-- doc.go | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aa90c21..7a861a0 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,9 @@ import dbmysql "code.nochebuena.dev/einherjar/db-mysql" db := dbmysql.New(logger, dbmysql.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 diff --git a/doc.go b/doc.go index d6f7591..b13fb76 100644 --- a/doc.go +++ b/doc.go @@ -14,8 +14,12 @@ // # Lifecycle Registration // // db := mysql.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 //