Skip to content

a lightweight and flexible dependency injection library for Go

Notifications You must be signed in to change notification settings

binodta/depWeaver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DepWeaver

depWeaver is a lightweight and flexible dependency injection library for Go (Golang) projects. It is designed to simplify the process of managing dependencies in your applications by allowing you to define and resolve dependencies at runtime based on the functions' requirements.

Installation

To install depWeaver, use the Go tool:

go get github.com/binodta/depWeaver

Usage

Basic usage of depWeaver is as follows:

	constructors := []interface{}{
		NewUserService,
		NewConfig,
		NewDatabaseConnection,
		NewLoggerService,
		NewUserRepository,
	}
	
	
	// Initialize the dependency injection container
	di.Init(constructors)
	
	// Resolve the dependencies
	service, error := di.Resolve[*UserService]()

About

a lightweight and flexible dependency injection library for Go

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages