first commit
This commit is contained in:
28
plugins/example.lua
Normal file
28
plugins/example.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
-- example.lua
|
||||
version = "1.0.0"
|
||||
author = "futriis"
|
||||
description = "Example plugin"
|
||||
|
||||
function on_load()
|
||||
plugin_log("info", "Example plugin loaded")
|
||||
return true
|
||||
end
|
||||
|
||||
function on_start()
|
||||
plugin_log("info", "Example plugin started")
|
||||
|
||||
-- Получаем коллекцию
|
||||
local coll = get_collection("test_db", "test_coll")
|
||||
if coll then
|
||||
-- Вставляем документ
|
||||
coll:insert({name = "test", value = 42})
|
||||
plugin_log("info", "Document inserted")
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function process_data(data)
|
||||
plugin_log("debug", "Processing: " .. data)
|
||||
return {processed = true, original = data}
|
||||
end
|
||||
Reference in New Issue
Block a user