LuaJIT
Ada has a LuaJIT / OpenResty client available on Github, and also on luarocks.org and https://opm.openresty.org/.
Installation
Section titled “Installation”Using LuaRocks
Section titled “Using LuaRocks”luarocks install lua-resty-adaLuaRocks repository for lua-resty-ada is located at
luarocks.org/modules/bungle/lua-resty-ada.
Using OpenResty Package Manager
Section titled “Using OpenResty Package Manager”opm get bungle/lua-resty-adaOPM repository for lua-resty-ada is located at
opm.openresty.org/package/bungle/lua-resty-ada.
Please consult the API documentation for a more detailed information.
URL class
Section titled “URL class”The resty.ada can parse URL and return an instance of URL:
local ada_url = require("resty.ada")local url = ada_url.parse("https://example.org/path/file.txt")local protocol = url:get_protocol()url:free() -- explicit free (garbage collector would do it implicitly)print(protocol) -- "https:"Static functions
Section titled “Static functions”The library can also be used without creating instances:
local ada_url = require("resty.ada")local protocol = ada_url.get_protocol("https://example.org/path/file.txt")print(protocol) -- "https:"