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.
-
starlark-go
Starlark in Go: the Starlark configuration language, implemented in Go -
cel-go
Fast, portable, non-Turing complete expression evaluation with gradual typing (Go) -
Gentee script programming language
Gentee - script programming language for automation. It uses VM and compiler written in Go (Golang). -
ecal
A simple embeddable scripting language which supports concurrent event processing. -
ngaro
An embeddable implementation of the Ngaro Virtual Machine for Go programs
Clean code begins in your IDE with SonarLint
* 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]
}