Description
this is a rule engine that consists of functions, inputs, and outputs.
its pattern consists of multiple rows of:
condition | action[s]
it is very good for rule scripting inside a go project.
it has serialization capabilities.
mosalat alternatives and similar packages
Based on the "Embeddable Scripting Languages" category.
Alternatively, view mosalat alternatives based on common mentions on social networks and blogs.
-
expr
DISCONTINUED. Expression language and expression evaluation for Go [Moved to: https://github.com/expr-lang/expr] -
Gentee script programming language
Gentee - script programming language for automation. It uses VM and compiler written in Go (Golang).
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of mosalat or a related project?
Popular Comparisons
README
Example:
func now() int64 { return time.Now().Unix() }
func days(count float64) float64 {
return count * 24 * 60 * 60
}
func main() {
funcMap := map[string]interface{}{
"now": now,
"days": days,
}
inputMap := map[string]interface{}{
"registered_date": time.Now().Unix(),
"sales_amount": 2000000,
}
outputMap := map[string]interface{}{
"plan_name": "premium_1",
}
output, err := mosalat.Run([]string{
`now() > registered_date + days(14) && plan_name == "premium_1" | plan_name = "free"`,
`plan_name == "premium_1" | plan_name = "free"`,
`plan_name == "free" | feature_1 = true`,
}, funcMap, inputMap, outputMap) // --> [plan_name: "free", feature_1: true]
}