package
1.1.43
Repository: https://github.com/d0ngw/go.git
Documentation: pkg.go.dev

# README

Dependency injection for go,similiar to Guice

# Functions

IsInjected 判断i是否实现了Injected接口 当i实现了Injected接口时,ok为true,这时injected表示接口i是否已经完成了注入.
Merge 合并Module.
NewInjector 创建一个Injector.
NewModule 创建新的Module.
SetupInjector 从env指定的环境配置初始化配置,构建Injector.
SetupInjectorWithLoader 从env指定的环境配置初始化配置,构建Injector.

# Constants

EnvConfRoot conf root.

# Structs

Injector is a injector like Guice Injector type InjectStruct struct{ s ServiceInterface{} `inject:"<name|_>,[optional]"` }.
Module 提供Guice Module的功能.

# Interfaces

ConfigModuler get module depends on the config.
Injected 判断是否已经完成注入.
Provider 提供类似Guice Provider的功能,用于创建一个对象.

# Type aliases

ProviderFunc 定义用于创建一个对象的函数类型.