Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uber-go/dig
A reflection based dependency injection toolkit for Go.
https://github.com/uber-go/dig
dependency-injection di go golang
Last synced: 4 days ago
JSON representation
A reflection based dependency injection toolkit for Go.
- Host: GitHub
- URL: https://github.com/uber-go/dig
- Owner: uber-go
- License: mit
- Created: 2017-03-21T23:55:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-02T21:05:44.000Z (3 months ago)
- Last Synced: 2024-10-26T06:54:36.630Z (about 2 months ago)
- Topics: dependency-injection, di, go, golang
- Language: Go
- Homepage: https://go.uber.org/dig
- Size: 739 KB
- Stars: 3,905
- Watchers: 44
- Forks: 206
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - dig - A reflection based dependency injection toolkit for Go. (Miscellaneous / Dependency Injection)
- zero-alloc-awesome-go - dig - A reflection based dependency injection toolkit for Go. (Miscellaneous / Dependency Injection)
- go-awesome - dig
- awesome-go - dig - A reflection based dependency injection toolkit for Go. Stars:`4.0K`. (Miscellaneous / Dependency Injection)
- awesome-go-extra - dig - 03-21T23:55:50Z|2022-08-16T22:34:23Z| (Microsoft Office / Dependency Injection)
- awesome-go - dig - 基于反射的依赖注入工具包。 (常用依赖注入库 / 交互工具)
- awesome-go - dig - 基于反射的依赖注入工具包。 (常用依赖注入库 / 交互工具)
README
# :hammer_and_pick: dig [![GoDoc][doc-img]][doc] [![GitHub release][release-img]][release] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Go Report Card][report-card-img]][report-card]
A reflection based dependency injection toolkit for Go.
### Good for:
* Powering an application framework, e.g. [Fx](https://github.com/uber-go/fx).
* Resolving the object graph during process startup.### Bad for:
* Using in place of an application framework, e.g. [Fx](https://github.com/uber-go/fx).
* Resolving dependencies after the process has already started.
* Exposing to user-land code as a [Service Locator](https://martinfowler.com/articles/injection.html#UsingAServiceLocator).## Installation
We recommend consuming [SemVer](http://semver.org/) major version `1` using
your dependency manager of choice.```
$ glide get 'go.uber.org/dig#^1'
$ dep ensure -add "go.uber.org/dig@v1"
$ go get 'go.uber.org/dig@v1'
```## Stability
This library is `v1` and follows [SemVer](http://semver.org/) strictly.
No breaking changes will be made to exported APIs before `v2.0.0`.
[doc-img]: http://img.shields.io/badge/GoDoc-Reference-blue.svg
[doc]: https://godoc.org/go.uber.org/dig[release-img]: https://img.shields.io/github/release/uber-go/dig.svg
[release]: https://github.com/uber-go/dig/releases[ci-img]: https://github.com/uber-go/dig/actions/workflows/go.yml/badge.svg
[ci]: https://github.com/uber-go/dig/actions/workflows/go.yml[cov-img]: https://codecov.io/gh/uber-go/dig/branch/master/graph/badge.svg
[cov]: https://codecov.io/gh/uber-go/dig/branch/master[report-card-img]: https://goreportcard.com/badge/github.com/uber-go/dig
[report-card]: https://goreportcard.com/report/github.com/uber-go/dig## Stargazers over time
[![Stargazers over time](https://starchart.cc/uber-go/dig.svg)](https://starchart.cc/uber-go/dig)