Documentation
¶
Overview ¶
Package util is a generated GoMock package.
Index ¶
- func FileLineFromPC(fn interface{}) (file string, line int, fnName string)
- func HasReceiver(t reflect.Type, receiver reflect.Value) bool
- func Indirect(t reflect.Type) reflect.Type
- func IsBeanReceiver(t reflect.Type) bool
- func IsBeanType(t reflect.Type) bool
- func IsConstructor(t reflect.Type) bool
- func IsContextType(t reflect.Type) bool
- func IsConverter(t reflect.Type) bool
- func IsErrorType(t reflect.Type) bool
- func IsFuncType(t reflect.Type) bool
- func IsPrimitiveValueType(t reflect.Type) bool
- func IsStructPtr(t reflect.Type) bool
- func IsValueType(t reflect.Type) bool
- func Keys(i interface{}) []string
- func PatchValue(v reflect.Value) reflect.Value
- func ReturnNothing(t reflect.Type) bool
- func ReturnOnlyError(t reflect.Type) bool
- func SortedKeys(i interface{}) []string
- func TypeName(i interface{}) string
- type BeanDefinition
- type BeanSelector
- type Converter
- type MockBeanDefinition
- func (m *MockBeanDefinition) BeanName() string
- func (m *MockBeanDefinition) Created() bool
- func (m *MockBeanDefinition) EXPECT() *MockBeanDefinitionMockRecorder
- func (m *MockBeanDefinition) ID() string
- func (m *MockBeanDefinition) Interface() interface{}
- func (m *MockBeanDefinition) Type() reflect.Type
- func (m *MockBeanDefinition) TypeName() string
- func (m *MockBeanDefinition) Value() reflect.Value
- func (m *MockBeanDefinition) Wired() bool
- type MockBeanDefinitionMockRecorder
- func (mr *MockBeanDefinitionMockRecorder) BeanName() *gomock.Call
- func (mr *MockBeanDefinitionMockRecorder) Created() *gomock.Call
- func (mr *MockBeanDefinitionMockRecorder) ID() *gomock.Call
- func (mr *MockBeanDefinitionMockRecorder) Interface() *gomock.Call
- func (mr *MockBeanDefinitionMockRecorder) Type() *gomock.Call
- func (mr *MockBeanDefinitionMockRecorder) TypeName() *gomock.Call
- func (mr *MockBeanDefinitionMockRecorder) Value() *gomock.Call
- func (mr *MockBeanDefinitionMockRecorder) Wired() *gomock.Call
- type MockBeanSelector
- type MockBeanSelectorMockRecorder
- type MockConverter
- type MockConverterMockRecorder
- type PanicCond
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileLineFromPC ¶
FileLineFromPC returns a function's name, file name and line number.
func HasReceiver ¶
HasReceiver returns whether the function has a receiver.
func IsBeanReceiver ¶
IsBeanReceiver returns whether the `t` is a bean receiver, a bean receiver can be a bean, a map or slice whose elements are beans.
func IsBeanType ¶
IsBeanType returns whether `t` is a bean type.
func IsConstructor ¶
IsConstructor returns whether `t` is a constructor type. What is a constructor? It should be a function first, has any number of inputs and supports the option pattern input, has one or two outputs and the second output should be an error.
func IsContextType ¶
IsContextType returns whether `t` is context.Context type.
func IsConverter ¶
IsConverter returns whether `t` is a converter type.
func IsErrorType ¶
IsErrorType returns whether `t` is error type.
func IsPrimitiveValueType ¶
IsPrimitiveValueType returns whether `t` is the primitive value type which only is int, unit, float, bool, string and complex.
func IsStructPtr ¶
IsStructPtr returns whether it is the pointer type of structure.
func IsValueType ¶
IsValueType returns whether the input type is the primitive value type and their composite type including array, slice, map and struct, such as []int, [3]string, []string, map[int]int, map[string]string, etc.
func Keys ¶
func Keys(i interface{}) []string
Keys returns the keys of the map m in indeterminate order.
func PatchValue ¶
PatchValue makes an unexported field can be assignable.
func ReturnNothing ¶
ReturnNothing returns whether the function has no return value.
func ReturnOnlyError ¶
ReturnOnlyError returns whether the function returns only error value.
func SortedKeys ¶
func SortedKeys(i interface{}) []string
SortedKeys returns the keys of the map m in sorted order.
Types ¶
type BeanDefinition ¶
type BeanDefinition interface { Type() reflect.Type Value() reflect.Value Interface() interface{} ID() string BeanName() string TypeName() string Created() bool Wired() bool }
A BeanDefinition describes a bean whose lifecycle is managed by IoC container.
type BeanSelector ¶
type BeanSelector interface{}
A BeanSelector can be the ID of a bean, a `reflect.Type`, a pointer such as `(*error)(nil)`, or a BeanDefinition value.
type Converter ¶
type Converter interface{}
Converter converts string value into user-defined value. It should be function type, and its prototype is func(string)(type,error).
type MockBeanDefinition ¶
type MockBeanDefinition struct {
// contains filtered or unexported fields
}
MockBeanDefinition is a mock of BeanDefinition interface.
func NewMockBeanDefinition ¶
func NewMockBeanDefinition(ctrl *gomock.Controller) *MockBeanDefinition
NewMockBeanDefinition creates a new mock instance.
func (*MockBeanDefinition) BeanName ¶
func (m *MockBeanDefinition) BeanName() string
BeanName mocks base method.
func (*MockBeanDefinition) Created ¶
func (m *MockBeanDefinition) Created() bool
Created mocks base method.
func (*MockBeanDefinition) EXPECT ¶
func (m *MockBeanDefinition) EXPECT() *MockBeanDefinitionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBeanDefinition) Interface ¶
func (m *MockBeanDefinition) Interface() interface{}
Interface mocks base method.
func (*MockBeanDefinition) Type ¶
func (m *MockBeanDefinition) Type() reflect.Type
Type mocks base method.
func (*MockBeanDefinition) TypeName ¶
func (m *MockBeanDefinition) TypeName() string
TypeName mocks base method.
func (*MockBeanDefinition) Value ¶
func (m *MockBeanDefinition) Value() reflect.Value
Value mocks base method.
func (*MockBeanDefinition) Wired ¶
func (m *MockBeanDefinition) Wired() bool
Wired mocks base method.
type MockBeanDefinitionMockRecorder ¶
type MockBeanDefinitionMockRecorder struct {
// contains filtered or unexported fields
}
MockBeanDefinitionMockRecorder is the mock recorder for MockBeanDefinition.
func (*MockBeanDefinitionMockRecorder) BeanName ¶
func (mr *MockBeanDefinitionMockRecorder) BeanName() *gomock.Call
BeanName indicates an expected call of BeanName.
func (*MockBeanDefinitionMockRecorder) Created ¶
func (mr *MockBeanDefinitionMockRecorder) Created() *gomock.Call
Created indicates an expected call of Created.
func (*MockBeanDefinitionMockRecorder) ID ¶
func (mr *MockBeanDefinitionMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID.
func (*MockBeanDefinitionMockRecorder) Interface ¶
func (mr *MockBeanDefinitionMockRecorder) Interface() *gomock.Call
Interface indicates an expected call of Interface.
func (*MockBeanDefinitionMockRecorder) Type ¶
func (mr *MockBeanDefinitionMockRecorder) Type() *gomock.Call
Type indicates an expected call of Type.
func (*MockBeanDefinitionMockRecorder) TypeName ¶
func (mr *MockBeanDefinitionMockRecorder) TypeName() *gomock.Call
TypeName indicates an expected call of TypeName.
func (*MockBeanDefinitionMockRecorder) Value ¶
func (mr *MockBeanDefinitionMockRecorder) Value() *gomock.Call
Value indicates an expected call of Value.
func (*MockBeanDefinitionMockRecorder) Wired ¶
func (mr *MockBeanDefinitionMockRecorder) Wired() *gomock.Call
Wired indicates an expected call of Wired.
type MockBeanSelector ¶
type MockBeanSelector struct {
// contains filtered or unexported fields
}
MockBeanSelector is a mock of BeanSelector interface.
func NewMockBeanSelector ¶
func NewMockBeanSelector(ctrl *gomock.Controller) *MockBeanSelector
NewMockBeanSelector creates a new mock instance.
func (*MockBeanSelector) EXPECT ¶
func (m *MockBeanSelector) EXPECT() *MockBeanSelectorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockBeanSelectorMockRecorder ¶
type MockBeanSelectorMockRecorder struct {
// contains filtered or unexported fields
}
MockBeanSelectorMockRecorder is the mock recorder for MockBeanSelector.
type MockConverter ¶
type MockConverter struct {
// contains filtered or unexported fields
}
MockConverter is a mock of Converter interface.
func NewMockConverter ¶
func NewMockConverter(ctrl *gomock.Controller) *MockConverter
NewMockConverter creates a new mock instance.
func (*MockConverter) EXPECT ¶
func (m *MockConverter) EXPECT() *MockConverterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockConverterMockRecorder ¶
type MockConverterMockRecorder struct {
// contains filtered or unexported fields
}
MockConverterMockRecorder is the mock recorder for MockConverter.
type PanicCond ¶
type PanicCond struct {
// contains filtered or unexported fields
}
PanicCond panic condition.
func NewPanicCond ¶
func NewPanicCond(fn func() interface{}) *PanicCond
NewPanicCond returns a panic condition.
func Panic ¶
func Panic(err interface{}) *PanicCond
Panic returns a panic condition that throws an error.