Expand description
Lua scripted connector runtime.
Loads .lua connector scripts at runtime and executes them in a sandboxed
Lua 5.4 VM. Each script implements connector.scan(config) → items[],
returning documents that flow into the standard ingestion pipeline.
§Architecture
The Lua VM runs on a blocking thread via [tokio::task::spawn_blocking]
to avoid blocking the async runtime. HTTP calls use reqwest::blocking,
and sleep() uses std::thread::sleep.
§Host APIs
Scripts have access to sandboxed host APIs provided by crate::lua_runtime:
| Module | Functions |
|---|---|
http | get, post, put |
json | parse, encode |
env | get |
log | info, warn, error, debug |
fs | read, list (sandboxed to script directory) |
base64 | encode, decode |
crypto | sha256, hmac_sha256 |
sleep | sleep(seconds) |
§Configuration
[connectors.script.jira]
path = "connectors/jira.lua"
timeout = 600
url = "https://mycompany.atlassian.net"
api_token = "${JIRA_API_TOKEN}"See docs/LUA_CONNECTORS.md for the full specification.
Structs§
- Script
Connector - A Lua scripted connector instance that implements the
Connectortrait.
Functions§
- lua_
table_ 🔒to_ source_ items - Convert a Lua array table into a Vec of SourceItems.
- parse_
lua_ 🔒timestamp - Parse a timestamp from a Lua table field.
- run_
lua_ 🔒scan - Execute a Lua connector script and return the resulting source items.
- scaffold_
connector - Scaffold a new connector script from a template.
- scan_
script - Scan a Lua script connector and return the ingested items.
- test_
script - Test a connector script without writing to the database.