Documentation
¶
Overview ¶
Package cond 提供了判断 bean 注册是否有效的条件。
Package cond is a generated GoMock package.
Index ¶
- Constants
- func Group(op Operator, cond ...Condition) *group
- func New() *conditional
- func Not(c Condition) *not
- func On(cond Condition) *conditional
- func OnBean(selector BeanSelector) *conditional
- func OnExpression(expression string) *conditional
- func OnMatches(fn MatchesFunc) *conditional
- func OnMissingBean(selector BeanSelector) *conditional
- func OnMissingProperty(name string) *conditional
- func OnProfile(profile string) *conditional
- func OnProperty(name string, options ...PropertyOption) *conditional
- func OnSingleBean(selector BeanSelector) *conditional
- type BeanDefinition
- type BeanSelector
- type Condition
- type Context
- type MatchesFunc
- type MockCondition
- type MockConditionMockRecorder
- type MockContext
- type MockContextMockRecorder
- type Operator
- type PropertyOption
Constants ¶
const ( Or = Operator(1) // 条件成立必须至少一个满足。 And = Operator(2) // 条件成立必须所有都要满足。 None = Operator(3) // 条件成立必须没有一个满足。 )
Variables ¶
This section is empty.
Functions ¶
func OnExpression ¶
func OnExpression(expression string) *conditional
OnExpression 返回一个以 onExpression 为开始条件的计算式。
func OnMissingBean ¶
func OnMissingBean(selector BeanSelector) *conditional
OnMissingBean 返回一个以 onMissingBean 为开始条件的计算式。
func OnMissingProperty ¶
func OnMissingProperty(name string) *conditional
OnMissingProperty 返回一个以 onMissingProperty 为开始条件的计算式。
func OnProfile ¶
func OnProfile(profile string) *conditional
OnProfile 返回一个以 spring.profile 属性值是否匹配为开始条件的计算式。
func OnProperty ¶
func OnProperty(name string, options ...PropertyOption) *conditional
OnProperty 返回一个以 onProperty 为开始条件的计算式。
func OnSingleBean ¶
func OnSingleBean(selector BeanSelector) *conditional
OnSingleBean 返回一个以 onSingleBean 为开始条件的计算式。
Types ¶
type BeanDefinition ¶
type BeanDefinition = internal.BeanDefinition
type BeanSelector ¶
type BeanSelector = internal.BeanSelector
type Context ¶
type Context interface {
Has(key string) bool
Prop(key string, opts ...conf.GetOption) string
Find(selector BeanSelector) ([]BeanDefinition, error)
}
type MatchesFunc ¶
type MockCondition ¶
type MockCondition struct {
// contains filtered or unexported fields
}
MockCondition is a mock of Condition interface.
func NewMockCondition ¶
func NewMockCondition(ctrl *gomock.Controller) *MockCondition
NewMockCondition creates a new mock instance.
func (*MockCondition) EXPECT ¶
func (m *MockCondition) EXPECT() *MockConditionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockConditionMockRecorder ¶
type MockConditionMockRecorder struct {
// contains filtered or unexported fields
}
MockConditionMockRecorder is the mock recorder for MockCondition.
func (*MockConditionMockRecorder) Matches ¶
func (mr *MockConditionMockRecorder) Matches(ctx interface{}) *gomock.Call
Matches indicates an expected call of Matches.
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) EXPECT ¶
func (m *MockContext) EXPECT() *MockContextMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockContext) Find ¶
func (m *MockContext) Find(selector BeanSelector) ([]BeanDefinition, error)
Find mocks base method.
type MockContextMockRecorder ¶
type MockContextMockRecorder struct {
// contains filtered or unexported fields
}
MockContextMockRecorder is the mock recorder for MockContext.
func (*MockContextMockRecorder) Find ¶
func (mr *MockContextMockRecorder) Find(selector interface{}) *gomock.Call
Find indicates an expected call of Find.
func (*MockContextMockRecorder) Has ¶
func (mr *MockContextMockRecorder) Has(key interface{}) *gomock.Call
Has indicates an expected call of Has.
func (*MockContextMockRecorder) Prop ¶
func (mr *MockContextMockRecorder) Prop(key interface{}, opts ...interface{}) *gomock.Call
Prop indicates an expected call of Prop.
type PropertyOption ¶
type PropertyOption func(*onProperty)
func HavingValue ¶
func HavingValue(havingValue string) PropertyOption
HavingValue 当 havingValue 与属性值相同时条件成立。