Documentation ¶
Overview ¶
Package arg 用于实现函数参数绑定。
Package arg is a generated GoMock package.
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 wrappers a function and its binding arguments, then you can invoke the Call method of Callable to get the function's result.
func Bind ¶
Bind returns a Callable that wrappers a function and its binding arguments. The argument skip is the number of frames to skip over.
type Context ¶
type Context interface { // Matches returns true when the Condition returns true, // and returns false when the Condition returns false. Matches(c cond.Condition) (bool, error) // Bind binds properties value by the "value" tag. Bind(v reflect.Value, tag string) error // Wire wires dependent beans by the "autowire" tag. Wire(v reflect.Value, tag string) error }
Context defines some methods of IoC container that Callable use.
type IndexArg ¶
type IndexArg struct {
// contains filtered or unexported fields
}
IndexArg is an Arg that has an index.
type MockArg ¶
type MockArg struct {
// contains filtered or unexported fields
}
MockArg is a mock of Arg interface.
func NewMockArg ¶
func NewMockArg(ctrl *gomock.Controller) *MockArg
NewMockArg creates a new mock instance.
func (*MockArg) EXPECT ¶
func (m *MockArg) EXPECT() *MockArgMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockArgMockRecorder ¶
type MockArgMockRecorder struct {
// contains filtered or unexported fields
}
MockArgMockRecorder is the mock recorder for MockArg.
type MockContext ¶
type MockContext struct {
// contains filtered or unexported fields
}
MockContext is a mock of Context interface.
func NewMockContext ¶
func NewMockContext(ctrl *gomock.Controller) *MockContext
NewMockContext creates a new mock instance.
func (*MockContext) Bind ¶
func (m *MockContext) Bind(v reflect.Value, tag string) error
Bind mocks base method.
func (*MockContext) EXPECT ¶
func (m *MockContext) EXPECT() *MockContextMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockContextMockRecorder ¶
type MockContextMockRecorder struct {
// contains filtered or unexported fields
}
MockContextMockRecorder is the mock recorder for MockContext.
func (*MockContextMockRecorder) Bind ¶
func (mr *MockContextMockRecorder) Bind(v, tag interface{}) *gomock.Call
Bind indicates an expected call of Bind.
func (*MockContextMockRecorder) Matches ¶
func (mr *MockContextMockRecorder) Matches(c interface{}) *gomock.Call
Matches indicates an expected call of Matches.
func (*MockContextMockRecorder) Wire ¶
func (mr *MockContextMockRecorder) Wire(v, tag interface{}) *gomock.Call
Wire indicates an expected call of Wire.