assemble is a pragmatic, lightweight dependency injection (DI) library for Go.
It focuses on clarity, type safety, and zero reflection through a combination of runtime and generated dependency graphs.
- 🧩 Strongly typed DI container — safe, reflection-free dependency resolution
- ⚙️ Static code generation: compile-time wiring for performance and safety
- 🔄 Lifecycle hooks:
OnStart,OnStop, plus type-awareOnStartFor[T]/OnStopFor[T] - 🧠 Deterministic startup and shutdown based on creation order and priorities
- ⏱️ Timeouts and multi-error aggregation for clean lifecycle management
- 🧭 Graph export (DOT / PlantUML) for visualizing dependency and shutdown order
- 🧰 Designed for modular services, CLIs, and testable applications
To use and import the library, run:
go get github.com/xfrr/assembleTo install the generator tool, run:
go install github.com/xfrr/assemble/cmd/assemblegen@latestCheck the example for a complete usage demonstration.
MIT License. See LICENSE for details.