add a 'Upper' expr helper
This commit is contained in:
parent
f2e38b0d28
commit
ccf6ff212d
1 changed files with 11 additions and 6 deletions
|
@ -32,6 +32,10 @@ func EndsWith(s string, suff string) bool {
|
|||
return strings.HasSuffix(s, suff)
|
||||
}
|
||||
|
||||
func Upper(s string) string {
|
||||
return strings.ToUpper(s)
|
||||
}
|
||||
|
||||
func GetExprEnv(ctx map[string]interface{}) map[string]interface{} {
|
||||
var ExprLib = map[string]interface{}{
|
||||
"Atof": Atof,
|
||||
|
@ -41,6 +45,7 @@ func GetExprEnv(ctx map[string]interface{}) map[string]interface{} {
|
|||
"JsonExtractLib": JsonExtractLib,
|
||||
"File": File,
|
||||
"RegexpInFile": RegexpInFile,
|
||||
"Upper": Upper,
|
||||
}
|
||||
for k, v := range ctx {
|
||||
ExprLib[k] = v
|
||||
|
|
Loading…
Add table
Reference in a new issue