$ luarocks install lua-resty-radixtree
local radix = require("resty.radixtree")
local rx = radix.new({
{
path = "/aa",
metadata = "metadata /aa",
host = "foo.com",
method = {"GET", "POST"},
remote_addr = "127.0.0.1",
},
{
path = "/bb*",
metadata = "metadata /bb",
host = {"*.bar.com", "gloo.com"},
method = {"GET", "POST", "PUT"},
remote_addr = {"fe80:fe80::/64", "127.0.0.1"},
}
})
-- should hit
ngx.say(rx:match("/aa", {host = "foo.com",
method = "GET",
remote_addr = "127.0.0.1"}))
Versions
Dependencies
lua-resty-expr = 1.3.0