Files
core/launcher/doc.go
T
Rene Nochebuena a7fa7fc51a docs(core): fix logz.Options -> logz.Config in doc examples; bump to v1.1.0
Coordinated framework release. Documentation-only code change plus the shared
version bump.

- core/launcher/doc.go, core/logz/doc.go: logz.New(logz.Options{...}) ->
  logz.Config (Options was retired per ADR-003; the constructor takes Config).
- go.mod: contracts -> v1.1.0 (via go get + go mod tidy).

Verified by compiling the example patterns against the real API. Badge -> v1.1.0.
2026-08-07 18:41:49 -06:00

28 lines
858 B
Go

// Package launcher orchestrates the application lifecycle.
//
// A Launcher manages infrastructure components through three ordered phases:
//
// 1. OnInit — all components initialize in registration order
// 2. BeforeStart hooks — dependency injection wiring runs
// 3. OnStart — all components start in registration order
//
// On shutdown (OS signal or programmatic Shutdown call), OnStop is called for
// every component in reverse registration order, ensuring dependents stop
// before their dependencies.
//
// Usage:
//
// logger := logz.New(logz.Config{JSON: true})
// lc := launcher.New(logger)
//
// lc.Append(db, cache, server)
// lc.BeforeStart(func() error {
// return server.RegisterRoutes(db, cache)
// })
//
// if err := lc.Run(); err != nil {
// logger.Error("launcher failed", err)
// os.Exit(1)
// }
package launcher