Documentation
¶
Overview ¶
Package arg 用于实现函数参数绑定。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Arg ¶
type Arg interface{}
Arg 用于为函数参数提供绑定值。可以是 bean.Selector 类型,表示注入 bean ; 可以是 ${X:=Y} 形式的字符串,表示属性绑定或者注入 bean ;可以是 ValueArg 类型,表示不从 IoC 容器获取而是用户传入的普通值;可以是 IndexArg 类型,表示 带有下标的参数绑定;可以是 *optionArg 类型,用于为 Option 方法提供参数绑定。
type Callable ¶
type Callable struct {
// contains filtered or unexported fields
}
Callable 绑定函数及其参数,然后通过 Call 方法获取绑定函数的执行结果。
type Context ¶
type Context interface {
// Matches 条件成立返回 true,否则返回 false。
Matches(c cond.Condition) (bool, error)
// Bind 根据 tag 的内容对 v 进行属性绑定。
Bind(v reflect.Value, tag string) error
// Wire 根据 tag 的内容对 v 进行依赖注入。
Wire(v reflect.Value, tag string) error
}
Context IoC 容器对 arg 模块提供的最小功能集。
Click to show internal directories.
Click to hide internal directories.