di-container

module
v0.0.0-...-3e624d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2023 License: MIT

README

DI container for Go

Simpler compile-time dependency injection and a runtime singleton container for go. Inspired by Wire and Symfony Service Container

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.

Directories

Path Synopsis
cmd
initgen
package initgen generates initializers for provider functions registered in the current working dir package.
package initgen generates initializers for provider functions registered in the current working dir package.
DO NOT EDIT.
DO NOT EDIT.
cmd
internal
dag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL