Documentation
¶
Overview ¶
Package arg provide a method arguments binding。
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 is used to provide binding values for function parameters. It can be of type bean.Selector, indicating injection of a bean. It can be a string in the form of ${X:=Y}, representing property binding or injection of a bean. It can be of type ValueArg, representing a regular value passed by the user instead of being retrieved from the IoC container. It can be of type IndexArg, representing parameter binding with an index. It can be of type *optionArg, used to provide parameter binding for the Option method.
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.