mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-15 04:53:00 +08:00
🤞 Sync 2026-11-10 13:45:37
This commit is contained in:
1 parent
7822fc98cf
commit
97dc33e800
640 files changed
+108562
-5
No files matched your search
@@ -0,0 +1,24 @@
|
||||
-- Stubs for the two LuCI modules the bridge pulls in through rpc.lua.
|
||||
--
|
||||
-- The bridge's mapping is pure; loading it must not require a router. nixio is
|
||||
-- reduced to the one call rpc makes at load time, and jsonc to encode/decode
|
||||
-- shapes the probe never exercises -- if a mapping function ever starts using
|
||||
-- them, these stubs fail loudly rather than silently returning nothing.
|
||||
package.preload["nixio"] = function()
|
||||
return {
|
||||
getpid = function() return 4242 end,
|
||||
socket = function() error("the probe must not open a socket") end,
|
||||
fork = function() error("the probe must not fork") end,
|
||||
}
|
||||
end
|
||||
|
||||
-- rpc.lua loads nixio.util for the socket's writeall/readall. Loading it adds
|
||||
-- methods and returns nothing the probe calls.
|
||||
package.preload["nixio.util"] = function() return {} end
|
||||
|
||||
package.preload["luci.jsonc"] = function()
|
||||
return {
|
||||
stringify = function() error("the probe must not encode a frame") end,
|
||||
parse = function() error("the probe must not decode a frame") end,
|
||||
}
|
||||
end
|
||||
Reference in new issue
Block a user