1 -- Copyright 2009 Steven Barth <steven@midlink.org>
2 -- Licensed to the public under the Apache License 2.0.
4 local util = require "luci.util"
5 local rawget, setmetatable = rawget, setmetatable
8 module "luci.rpcc.ruci"
11 local Proxy = util.class()
13 function factory(rpccl)
15 cursor = function(...)
16 return Proxy(rpccl, rpccl:request("ruci.cursor", {...}))
18 cursor_state = function(...)
19 return Proxy(rpccl, rpccl:request("ruci.cursor_state", {...}))
24 function Proxy.__init__(self, rpccl, objid)
29 __index = function(self, key)
30 return rawget(self, key) or Proxy[key] or function(self, ...)
31 local argv = {self.__objid, ...}
32 return self.__rpccl:request("ruci."..key, argv)
38 function Proxy.foreach(self, config, section, callback)
39 local sections = self.__rpccl:request("ruci.foreach", {self.__objid, config, section})
41 for _, s in ipairs(sections) do