Documentation ¶
Index ¶
Constants ¶
View Source
const ( Opa = "opa" Arango = "arango" Elastic = "elastic" )
Engine names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddonRule ¶
type AddonRule struct { ID uuid.UUID `json:"id"` Sources []int `json:"sources,omitempty"` Destinations []int `json:"destinations,omitempty"` BoardingPts []int `json:"boardingPts,omitempty"` DroppingPts []int `json:"droppingPts,omitempty"` BoardingTime *FloatRange `json:"boardingTime,omitempty"` DroppingTime *FloatRange `json:"droppingTime,omitempty"` SeatCount *NumRule `json:"seatCount,omitempty"` BusOperators []string `json:"busOperators,omitempty"` Duration *NumRule `json:"duration,omitempty"` Appversion *NumRule `json:"appversion,omitempty"` Channels []string `json:"channels,omitempty"` Addons []string `json:"addons"` }
AddonRule is composed of optional rule attributes and the list of addon IDs.
type AddonsQ ¶
type AddonsQ struct { Source int `json:"source"` Destination int `json:"destination"` BoardingPt int `json:"boardingPt"` DroppingPt int `json:"droppingPt"` BoardingTime float64 `json:"boardingTime"` DroppingTime float64 `json:"droppingTime"` Seats int `json:"seats"` BusOperator string `json:"busOperator"` Duration int `json:"duration"` Appversion int `json:"appversion"` Channel string `json:"channel"` // One of WEB_DIRECT, MOBILE_APP, MOBILE_WEB }
AddonsQ is the input which needs to be matched against addon rules.
type CompareOp ¶
type CompareOp string
CompareOp is one of equal to, greater than equal to and less than or equal to.
type Engine ¶
type Engine interface { // LoadRules loads the rules into the engine in preparation for // running the queries. LoadRules(ctx context.Context, rules []AddonRule) error // RunQuery matches the query against the addon rules loaded // into the rule engine. RunQuery(ctx context.Context, q AddonsQ) ([]string, error) }
Engine describes the functionality of an addon rule engine.
type Errors ¶
type Errors []error
Errors is an alias for slice of errors which satisfies the error interface.
type FloatRange ¶
FloatRange is a range of floating point numbers that the input is expected to match against.
Click to show internal directories.
Click to hide internal directories.