LabscoMCP early access ↗

Wires a long-running Go service together and owns its whole life — builds the parts, starts them in the right order, waits for a shutdown signal, then stops them in reverse.

WHEN TO USE

SCOPE

USE FOR

  • Wire a long-running service's startup and graceful shutdown with fx.New and Run().
  • Add OnStart and OnStop lifecycle hooks to a constructor instead of using init().
  • Group a service's providers, hooks, and decorators into a reusable fx.Module.
  • Bind a constructor's result to a name, group, or interface with fx.Annotate.
  • Validate an application's dependency graph in CI before it reaches production.
  • Swap a real dependency for a fake one in a test with fx.Replace.

NOT FOR

  • Wiring a CLI tool, library, or test harness that needs no lifecycle.