iocsvc

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[T any](name string) T

获取实例

func Has added in v1.0.0

func Has[T any](name string) bool

是否存在

func Init added in v1.0.0

func Init[T mcontract.IDefaultConfig](yaml string) (res T, err error)

初始化

func Inject

func Inject(instance interface{}, filterFunc func(reflect.Value) reflect.Value)

遍历实例内的需要依赖注入的字段进行注入

func Set

func Set[T any](instance T)

设置依赖注入

func SetWithName added in v1.0.0

func SetWithName[T any](name string, instance T)

置依赖注入

Types

This section is empty.

Jump to

Keyboard shortcuts

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