You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-16Lines changed: 1 addition & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@
9
9
-[Full path match](#full-path-match)
10
10
-[Prefix match](#prefix-match)
11
11
-[Parameters in path](#parameters-in-path)
12
-
-[Operator List](#operator-list)
13
12
-[match](#match)
14
13
-[dispatch](#dispatch)
15
14
-[Install](#install)
@@ -99,7 +98,7 @@ The attributes of each element may contain these:
99
98
|hosts |option |A list of client request host, not only supports normal domain name, but also supports wildcard name.|{"foo.com", "*.bar.com"}|
100
99
|remote_addrs|option |A list of client remote address(IPv4 and IPv6), and we can use CIDR format, eg `192.168.1.0/24`.|{"127.0.0.1", "192.0.0.0/8", "::1", "fe80::/32"}|
101
100
|methods |option |A list of method name. Here is full valid method list: "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT" and "TRACE".|{"GET", "POST"}|
102
-
|vars |option |A list of `{var, operator, val}`. For example: {{var, operator, val}, {var, operator, val}, ...}, `{"arg_name", "==", "json"}` means the value of argument `name` expect to `json`. Here is the full [Operator List](#operator-list).|{{"arg_name", "==", "json"}, {"arg_age", ">", 18}}|
101
+
|vars |option |A DSL to evaluate with the given `opts.vars` or `ngx.var`. See https://github.com/api7/lua-resty-expr#new|{{"arg_name", "==", "json"}, {"arg_age", ">", 18}}|
103
102
|filter_fun |option |User defined filter function, We can use it to achieve matching logic for special scenes. `radixtree` will pass `vars` and other arguments when matching route.|function(vars) return vars["arg_name"] == "json" end|
104
103
|priority |option |Routing priority, default is 0.|priority = 100|
105
104
|metadata |option |Will return this field if using `rx:match` to match route.||
@@ -162,20 +161,6 @@ local rx = radix.new({
162
161
})
163
162
```
164
163
165
-
#### Operator List
166
-
167
-
|operator|description|example|
168
-
|--------|-----------|-------|
169
-
|== |equal |{"arg_name", "==", "json"}|
170
-
|~= |not equal |{"arg_name", "~=", "json"}|
171
-
|> |greater than|{"arg_age", ">", 24}|
172
-
|< |less than |{"arg_age", "<", 24}|
173
-
|~~|Regular match|{"arg_name", "~~", "[a-z]+"}|
174
-
|in |find in array|{"arg_name", "in", {"1","2"}}|
175
-
|has |left value array has value in the right |{"graphql_root_fields", "has", "repo"}|
0 commit comments