This commit is contained in:
AlteredCoder 2020-05-29 17:17:32 +02:00
parent 4e8aa19c09
commit 1df7dab2a4

View file

@ -33,7 +33,15 @@ func EndsWith(s string, suff string) bool {
}
func GetExprEnv(ctx map[string]interface{}) map[string]interface{} {
var ExprLib = map[string]interface{}{"Atof": Atof, "JsonExtract": JsonExtract, "JsonExtractLib": JsonExtractLib, "File": File, "RegexpInFile": RegexpInFile}
var ExprLib = map[string]interface{}{
"Atof": Atof,
"StartsWith": StartsWith,
"EndsWith" : EndsWith,
"JsonExtract": JsonExtract,
"JsonExtractLib": JsonExtractLib,
"File": File,
"RegexpInFile": RegexpInFile
}
for k, v := range ctx {
ExprLib[k] = v
}