An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 6.1% on proxy.golang.org
Top 2.8% dependent packages on proxy.golang.org

proxy.golang.org : github.com/maxzhang1985/inject

Package inject make your dependency injection easy. Container allows you to inject dependencies into constructors or structures without the need to have specified each argument manually. First of all, when creating a new container, you need to describe how to create each instance of a dependency. To do this, use the container option inject.Provide(). Now, container knows how to create *pkg.Dependency and *pkg.AnotherDependency. For advanced providing see inject.Provide() and inject.ProvideOption documentation. After building a container, it is easy to get any previously provided type. To do this, use the container's Extract() method. The container collects a dependencies of *pkg.AnotherDependency, creates its instance and places it in a target pointer. For advanced extraction see Extract() and inject.ExtractOption documentation.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/maxzhang1985/inject
License: MIT
Latest release: over 5 years ago
First release: almost 6 years ago
Namespace: github.com/maxzhang1985
Dependent packages: 3
Last synced: 11 days ago