MCPcopy Index your code
hub / github.com/Cheivin/di

github.com/Cheivin/di @v0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.0 ↗ · + Follow
185 symbols 351 edges 13 files 28 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

di

di是一个简易版本的Go依赖注入实现

文档地址

特性

  • 支持手动注册bean实例
  • 支持注册bean类型原型,由DI容器自动实例化并托管bean实例
  • 支持根据名称、类型获取DI容器托管的bean实例
  • 支持根据类型手动生成新的bean实例并返回
  • 支持配置项注入并转换成对应的基本类型
  • 支持匿名字段的bean注入

特别鸣谢

JetBrains

感谢 JetBrains 提供的开源开发许可证。

Extension points exported contracts — how you extend this code

BeanName (Interface)
BeanName 返回beanName [3 implementers]
bean_lifecycle_interface.go
DI (Interface)
(no doc) [1 implementers]
container_interface.go
Log (Interface)
(no doc) [1 implementers]
logger.go
ValueStore (Interface)
(no doc) [1 implementers]
value_store.go
OrderRepository (Interface)
(no doc) [1 implementers]
example/main.go
Disposable (Interface)
Disposable 在Bean注销时调用 [2 implementers]
bean_lifecycle_interface.go
DisposableWithContainer (Interface)
DisposableWithContainer 在Bean注销时调用 [2 implementers]
bean_lifecycle_interface.go
BeanConstruct (Interface)
BeanConstruct Bean实例创建时 [1 implementers]
bean_lifecycle_interface.go

Core symbols most depended-on inside this repo

Debug
called by 19
logger.go
Fatal
called by 10
logger.go
Info
called by 8
logger.go
Set
called by 8
value_store.go
isMap
called by 8
van/cast.go
SetProperty
called by 6
container_interface.go
Provide
called by 4
container_interface.go
Get
called by 4
value_store.go

Shape

Method 112
Function 42
Interface 16
Struct 15

Languages

Go100%

Modules by API surface

example/main.go25 symbols
bean_lifecycle_interface.go25 symbols
di.go24 symbols
global.go23 symbols
container_interface.go23 symbols
value_store.go13 symbols
logger.go13 symbols
van/store.go10 symbols
bean_lifecycle.go10 symbols
van/van.go6 symbols
bean_definition.go5 symbols
van/cast.go4 symbols

For agents

$ claude mcp add di \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact