reducer

package
v0.0.0-...-365054f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

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 True

func True(_ market.ServiceProposal) bool

True is a condition which is always true

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL