Registry / utility / depinject

depinject

JSON →
library1.2.1gogounverified

Package depinject provides a dependency injection container for Cosmos SDK modules.

go get cosmossdk.io/depinject
INSTALL
IMPORT
SIG · DEPINJECT
D
depinject
utilitygov1.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

depinject
cosmossdk.io/depinject

Basic dependency injection with supply and provide

package main import ( "fmt" "cosmossdk.io/depinject" ) type MyStruct struct { Name string } func main() { config := depinject.Configs( depinject.Supply("hello"), depinject.Provide(func(s string) MyStruct { return MyStruct{Name: s} }), ) var result MyStruct err := depinject.Inject(config, &result) if err != nil { panic(err) } fmt.Println(result.Name) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.2.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Resources
depinject — go get depinject · libregistry