Roadmap
- Create the injector using Go 1.18 generics (v1.0.0)
- Allow creating sub-injectors (v1.0.0)
- Refactor the Storage/Injector retrieval to return an
errorinstead of abool(v1.2.0, v1.3.0) - Remove use of
reflect.TypeOfin the injector (v1.2.0, v1.8.0)- Implement a method to get the type of
elementwithout usingreflect.TypeOf - Only use reflection if explicitly requested by the user
- Implement a method to get the type of
- Create an example directory showing how the injector can be used (v1.0.0)
- Add context-aware resolution (
WithContext) (v1.10.0)- Works like the current GetWithPairs method, but it will explicitly pass a only the context.Context
- Create an injector bind generator package using
//go:generatecomments
- Add RegisterConstructor wrappers to allow registering constructors directly (v1.8.2)
- Add alias & multi-binding support (v1.8.2)
- Allow registering a provider under multiple tags
- Support multiple implementations of the same interface
- Add RegisterConstructorVariadic wrapper, to allow constructors like NewValue(…T)
- Add module pattern support (v1.10.0)
- Improve error messages
- Swap error type to include more information about its origin (v1.9.0)
- Add dependency path traces (e.g., A → B → C failed)
- Add dependency graph visualization
- Probably export dependency graph to DOT/Graphviz
- Add API:
GetDependencyGraph(injector remy.Injector)- Due to the need of building the graph internally, it must be behind a build tag
- Add lifecycle hooks
-
OnRegister,OnResolvecallbacks - Support hook chaining
-
- Provide a fluent builder API
- Example:
CreateInjector().WithLogger(l).WithModules(m1, m2).Build()
- Example: