Documentation ¶
Index ¶
- func AccessPolicy(id, source string) func(market.ServiceProposal) bool
- func All() func(market.ServiceProposal) bool
- func And(conditions ...AndCondition) func(market.ServiceProposal) bool
- func Empty(field FieldSelector) func(market.ServiceProposal) bool
- func Equal(field FieldSelector, valueExpected interface{}) func(market.ServiceProposal) bool
- func EqualInt(field FieldSelector, valueExpected int) func(market.ServiceProposal) bool
- func EqualString(field FieldSelector, valueExpected string) func(market.ServiceProposal) bool
- func Field(field FieldSelector, reducer FieldCondition) func(market.ServiceProposal) bool
- func In(field FieldSelector, valuesExpected ...interface{}) func(market.ServiceProposal) bool
- func InInt(field FieldSelector, valuesExpected ...int) func(market.ServiceProposal) bool
- func InString(field FieldSelector, valuesExpected ...string) func(market.ServiceProposal) bool
- func Location(proposal market.ServiceProposal) interface{}
- func LocationCountry(proposal market.ServiceProposal) interface{}
- func LocationType(proposal market.ServiceProposal) interface{}
- func Not(condition Condition) func(market.ServiceProposal) bool
- func Or(conditions ...OrCondition) func(market.ServiceProposal) bool
- func ProviderID(proposal market.ServiceProposal) interface{}
- func ServiceType(proposal market.ServiceProposal) interface{}
- func True(_ market.ServiceProposal) bool
- func Unsupported() func(market.ServiceProposal) bool
- type AndCondition
- type Condition
- type FieldCondition
- type FieldSelector
- type OrCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessPolicy ¶
func AccessPolicy(id, source string) func(market.ServiceProposal) bool
AccessPolicy returns a matcher for checking if proposal allows given access policy
func All ¶
func All() func(market.ServiceProposal) bool
All returns a matcher for returning proposals, without checking any condition
func And ¶
func And(conditions ...AndCondition) func(market.ServiceProposal) bool
And returns a matcher for checking if all given conditions passes
func Empty ¶
func Empty(field FieldSelector) func(market.ServiceProposal) bool
Empty returns a matcher for checking if given field is empty
func Equal ¶
func Equal(field FieldSelector, valueExpected interface{}) func(market.ServiceProposal) bool
Equal returns a matcher for checking if proposal's field value equal to given value
func EqualInt ¶
func EqualInt(field FieldSelector, valueExpected int) func(market.ServiceProposal) bool
EqualInt returns a matcher for checking if proposal's integer field value equal to given value
func EqualString ¶
func EqualString(field FieldSelector, valueExpected string) func(market.ServiceProposal) bool
EqualString returns a matcher for checking if proposal's string field value equal to given value
func Field ¶
func Field(field FieldSelector, reducer FieldCondition) func(market.ServiceProposal) bool
Field returns a matcher for checking proposal's field value with custom callback
func In ¶
func In(field FieldSelector, valuesExpected ...interface{}) func(market.ServiceProposal) bool
In returns a matcher for checking if proposal's field value exists in given array of values
func InInt ¶
func InInt(field FieldSelector, valuesExpected ...int) func(market.ServiceProposal) bool
InInt returns a matcher for checking if proposal's integer field value exists in given array of values
func InString ¶
func InString(field FieldSelector, valuesExpected ...string) func(market.ServiceProposal) bool
InString returns a matcher for checking if proposal's string field value exists in given array of values
func Location ¶
func Location(proposal market.ServiceProposal) interface{}
Location selects service location from proposal
func LocationCountry ¶
func LocationCountry(proposal market.ServiceProposal) interface{}
LocationCountry selects location country from proposal
func LocationType ¶
func LocationType(proposal market.ServiceProposal) interface{}
LocationType selects location type from proposal
func Not ¶
func Not(condition Condition) func(market.ServiceProposal) bool
Not returns a matcher for checking if given conditions is negated
func Or ¶
func Or(conditions ...OrCondition) func(market.ServiceProposal) bool
Or returns a matcher for checking if one of given conditions passes
func ProviderID ¶
func ProviderID(proposal market.ServiceProposal) interface{}
ProviderID selects provider id value from proposal
func ServiceType ¶
func ServiceType(proposal market.ServiceProposal) interface{}
ServiceType selects service type from proposal
func Unsupported ¶
func Unsupported() func(market.ServiceProposal) bool
Unsupported filters out unsupported proposals
Types ¶
type AndCondition ¶
type AndCondition func(market.ServiceProposal) bool
AndCondition defines sub condition given for And()
type Condition ¶
type Condition func(market.ServiceProposal) bool
Condition defines sub condition given for Not()
type FieldCondition ¶
type FieldCondition func(value interface{}) bool
FieldCondition returns flag if field value matches against it's rules
type FieldSelector ¶
type FieldSelector func(proposal market.ServiceProposal) interface{}
FieldSelector callback to select field in proposal
type OrCondition ¶
type OrCondition func(market.ServiceProposal) bool
OrCondition defines sub condition given for Or()