git clone https://github.com/wwhai/rulex.git cd rulex make
./rulex run -db=main.db -config=conf/rulex.ini
浏览器输入:http://127.0.0.1:2580
function Success() -- do some things end function Failed(error) -- do some things end Actions = { function(data) return true, data end }
function Success() -- do some things end function Failed(error) -- do some things end Actions = { function(data) print("return => ", rulexlib:JqSelect(".[] | select(.hum < 20)", data)) return true, data end }
function Success() -- do some things end function Failed(error) -- do some things end Actions = { function(data) -- 持久化到 MongoDb: rulexlib:DataToMongo("45dd0c90f56d", data) -- 持久化到 Mysql: rulexlib:DataToMysql("45dd0c90f56d", data) -- 推送化到 Kafka: rulexlib:DataToKafka("45dd0c90f56d", data) return true, data end }
function Success() -- do some things end function Failed(error) -- do some things end Actions = { function(data) -- PyTorch 训练数据: cloud:PyTorchTrainCNN(data) -- PyTorch 识别: local V = cloud:PyTorchCNN(data) print(V) return true, data end }