https://github.com/mgnsk/di-container
Simpler compile-time dependency injection and a runtime singleton container for go.
https://github.com/mgnsk/di-container
autowire code-generation dependency dependency-injection di-container generator golang initializer ioc service-container
Last synced: about 1 year ago
JSON representation
Simpler compile-time dependency injection and a runtime singleton container for go.
- Host: GitHub
- URL: https://github.com/mgnsk/di-container
- Owner: mgnsk
- License: mit
- Created: 2020-04-19T16:44:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-17T15:08:16.000Z (about 3 years ago)
- Last Synced: 2024-06-20T16:33:25.078Z (almost 2 years ago)
- Topics: autowire, code-generation, dependency, dependency-injection, di-container, generator, golang, initializer, ioc, service-container
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## DI container for Go
Simpler compile-time dependency injection and a runtime singleton container for go. Inspired by [Wire](https://github.com/google/wire) and [Symfony Service Container](https://symfony.com/doc/current/service_container.html)
Installation: `go get github.com/mgnsk/di-container/cmd/initgen`
### Example
* `$ cd example`
* `$ go generate`
* Run the example app using the initializers: `$ go run cmd/main.go`
It is also possible to use the container dynamically on runtime. In that case it acts like a singleton container.