From 92714c5c611e2379fcb2b925aecce0826b698e58 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 5 Apr 2013 10:01:02 +0100 Subject: mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them --- plugins/mod_storage_none.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins/mod_storage_none.lua diff --git a/plugins/mod_storage_none.lua b/plugins/mod_storage_none.lua new file mode 100644 index 00000000..8f2d2f56 --- /dev/null +++ b/plugins/mod_storage_none.lua @@ -0,0 +1,23 @@ +local driver = {}; +local driver_mt = { __index = driver }; + +function driver:open(store) + return setmetatable({ store = store }, driver_mt); +end +function driver:get(user) + return {}; +end + +function driver:set(user, data) + return nil, "Storage disabled"; +end + +function driver:stores(username) + return { "roster" }; +end + +function driver:purge(user) + return true; +end + +module:provides("storage", driver); -- cgit v1.2.3