dix

package module
v0.3.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 1 Imported by: 7

README

dix

dix是一个依赖注入框架

它参考了dig的设计, 但是它能够完成更加复杂的依赖注入管理和namespace依赖隔离

功能描述

  1. 依赖注入循环检测
  2. dix 支持func, struct, map, list作为注入参数
  3. 支持 map key 作为 namespace 来进行依赖注入的数据隔离
  4. dix 支持 struct 对外提供多组依赖对象
  5. dix 支持 struct 依赖嵌套
  6. dix Inject 支持 func 和 struct 等多种模式进行数据注入
  7. dix 对象提供和注入对于原对象无任何侵入
  8. 详情请看Example

Documentation

Index

Constants

View Source
const (
	InjectMethodPrefix = dix_inter.InjectMethodPrefix
)

Variables

This section is empty.

Functions

func Inject added in v0.1.27

func Inject[T any](di *Dix, data T, opts ...Option) T

func Provide added in v0.3.1

func Provide(di *Dix, data any)

Types

type Dix

type Dix = dix_inter.Dix

func New

func New(opts ...Option) *Dix

type Graph

type Graph = dix_inter.Graph

type Option

type Option = dix_inter.Option

func WithValuesNull added in v0.3.9

func WithValuesNull() Option

type Options added in v0.0.9

type Options = dix_inter.Options

Directories

Path Synopsis
example
map
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL