Skip to content

Files

Latest commit

513b650 · Feb 19, 2025

History

History
35 lines (24 loc) · 748 Bytes

README.md

File metadata and controls

35 lines (24 loc) · 748 Bytes

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]()