ioc

package
v0.0.0-...-9c04300 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

参数生成器

type Chain

type Chain []*Builder

参数生成链

type Injector

type Injector = inject.Injector

type Invoker

type Invoker func(params ...interface{}) (arguments []interface{}, result []reflect.Value, err error)

依赖注入接口

type Squirt

type Squirt struct {
	// contains filtered or unexported fields
}

注入器

func New

func New() *Squirt

创建一个参数解释器

func (*Squirt) Copy

func (squirt *Squirt) Copy() *Squirt

拷贝一个注入器

func (*Squirt) Creator

func (squirt *Squirt) Creator(typo Type, creator interface{}) *Squirt

添加参数生成器

func (*Squirt) Creators

func (squirt *Squirt) Creators(creators ...interface{}) *Squirt

添加参数生成器

func (*Squirt) Error

func (squirt *Squirt) Error() error

查询状态

func (*Squirt) Handle

func (squirt *Squirt) Handle(handler interface{}, args ...interface{}) (Invoker, error)

生成一个接口

func (*Squirt) Params

func (squirt *Squirt) Params(params ...interface{}) *Squirt

添加基础参数

func (*Squirt) UnknownArgs

func (squirt *Squirt) UnknownArgs(handler interface{}, params ...interface{}) ([]Type, error)

获取依赖注入器中不存在的参数

type Type

type Type = reflect.Type

Jump to

Keyboard shortcuts

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