@@ -21,6 +21,7 @@ import (
2121 "context"
2222 "errors"
2323 "fmt"
24+ "github.com/expr-lang/expr/builtin"
2425 "io"
2526 "mime"
2627 "net/http"
@@ -1077,14 +1078,26 @@ func (s *server) FunctionsQuery(ctx context.Context, in *SimpleQuery) (reply *Pa
10771078 reply = & Pairs {}
10781079 in .Name = strings .ToLower (in .Name )
10791080
1080- for name , fn := range render .FuncMap () {
1081- lowerCaseName := strings .ToLower (name )
1082- if in .Name == "" || strings .Contains (lowerCaseName , in .Name ) {
1083- reply .Data = append (reply .Data , & Pair {
1084- Key : name ,
1085- Value : fmt .Sprintf ("%v" , reflect .TypeOf (fn )),
1086- Description : render .FuncUsage (name ),
1087- })
1081+ if in .Kind == "verify" {
1082+ for _ , fn := range builtin .Builtins {
1083+ lowerName := strings .ToLower (fn .Name )
1084+ if in .Name == "" || strings .Contains (lowerName , in .Name ) {
1085+ reply .Data = append (reply .Data , & Pair {
1086+ Key : fn .Name ,
1087+ Value : fmt .Sprintf ("%v" , reflect .TypeOf (fn .Func )),
1088+ })
1089+ }
1090+ }
1091+ } else {
1092+ for name , fn := range render .FuncMap () {
1093+ lowerName := strings .ToLower (name )
1094+ if in .Name == "" || strings .Contains (lowerName , in .Name ) {
1095+ reply .Data = append (reply .Data , & Pair {
1096+ Key : name ,
1097+ Value : fmt .Sprintf ("%v" , reflect .TypeOf (fn )),
1098+ Description : render .FuncUsage (name ),
1099+ })
1100+ }
10881101 }
10891102 }
10901103 return
0 commit comments