From: Vsevolod Stakhov Date: Tue, 18 Nov 2025 14:14:47 +0000 (+0000) Subject: [Minor] Add missing X-Git-Tag: 3.14.1~11^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf4654cfb0f9b5c7964cccc254eded839536f1b9;p=thirdparty%2Frspamd.git [Minor] Add missing --- diff --git a/lualib/lua_shape/plugin_schema.lua b/lualib/lua_shape/plugin_schema.lua new file mode 100644 index 0000000000..9e74f32848 --- /dev/null +++ b/lualib/lua_shape/plugin_schema.lua @@ -0,0 +1,18 @@ +local Registry = require "lua_shape.registry" + +local M = {} +local global_registry = Registry.global() + +function M.register(id, schema) + if not id or not schema then + error("plugin_schema.register requires id and schema") + end + + if not global_registry:get(id) then + global_registry:define(id, schema) + end + + return global_registry:get(id) +end + +return M