A dependency injection based application framework for Go.
A dependency injection based application framework for Go.
Fx is a dependency injection system for Go.
Benefits
init() or global variables. Use Fx-managed singletons.See our docs to get started and/or learn more about Fx.
Use Go modules to install Fx in your application.
go get go.uber.org/fx@v1To get started with Fx, start here.
This library is v1 and follows SemVer strictly.
No breaking changes will be made to exported APIs before v2.0.0.
This project follows the Go Release Policy. Each major version of Go is supported until there are two newer major releases.
Expose App.osExit method as an option
Feature: fx.AsType[T] as generic wrapper over fx.As(new(T))
fx not usable in restricted Go runtime environments due to syscall reference
Example of using fx for a short-lived CLI process?
API KEYS
Feature Request: Support for Partial Struct Initialization Pattern
A way to know that all OnStart hooks have completed
Populate a map by combining name and group attributes
fx.Evaluate: Support dynamic graphs by returning fx.Option from constructors
Add ability to override os.Exit for fxtest