Ecosyste.ms: Packages

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

Top 5.5% on proxy.golang.org
Top 3.4% dependent packages on proxy.golang.org
Top 4.8% dependent repos on proxy.golang.org
Top 8.2% forks on proxy.golang.org

proxy.golang.org : github.com/defval/inject/v2

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/defval/inject/v2
Keywords: dependency-injection, di, go, golang, injector, ioc, ioc-container
License: MIT
Latest release: over 4 years ago
First release: over 4 years ago
Namespace: github.com/defval/inject
Dependent packages: 3
Dependent repositories: 1
Stars: 49 on GitHub
Forks: 5 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 23 days ago

    Loading...
    Readme
    Loading...