docs(storage-minio): 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 storageminio "code.nochebuena.dev/einherjar/storage-minio"
|
import storageminio "code.nochebuena.dev/einherjar/storage-minio"
|
||||||
|
|
||||||
s := storageminio.New(logger, storageminio.DefaultConfig())
|
s := storageminio.New(logger, storageminio.DefaultConfig())
|
||||||
launcher.Append(s) // OnInit connects; OnStop is a no-op (stateless client)
|
lc.Append(s) // OnInit connects; OnStop is a no-op (stateless client)
|
||||||
health.Register(s) // BucketExists check; LevelCritical
|
// s is observability.Checkable (BucketExists check, LevelCritical):
|
||||||
|
srv.Get("/health", health.NewHandler(logger, s).ServeHTTP)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Uploading
|
### Uploading
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
// - OnStart: verifies the configured bucket exists; creates it if absent.
|
// - OnStart: verifies the configured bucket exists; creates it if absent.
|
||||||
// - OnStop: releases the client reference.
|
// - OnStop: releases the client reference.
|
||||||
//
|
//
|
||||||
// Register with the launcher and health aggregator before starting:
|
// Append to a launcher, and wire a health endpoint (mc satisfies
|
||||||
|
// [observability.Checkable]):
|
||||||
//
|
//
|
||||||
// mc := minio.New(logger, cfg)
|
// mc := minio.New(logger, cfg)
|
||||||
// launcher.Register(mc)
|
// lc.Append(mc) // lifecycle: OnInit → OnStart → OnStop
|
||||||
// health.Register(mc)
|
// srv.Get("/health", health.NewHandler(logger, mc).ServeHTTP)
|
||||||
//
|
//
|
||||||
// # Operations
|
// # Operations
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user