An open API service indexing awesome lists of open source software.

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.

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.