Mercurial > prosody-hg
comparison plugins/mod_storage_none.lua @ 8059:6a725b242804
mod_storage_none: Add allways empty archive storage
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 04 Apr 2017 01:31:51 +0200 |
| parents | 1b35a562528d |
| children | ef671d337577 |
comparison
equal
deleted
inserted
replaced
| 8058:1b35a562528d | 8059:6a725b242804 |
|---|---|
| 2 | 2 |
| 3 local driver = {}; | 3 local driver = {}; |
| 4 local driver_mt = { __index = driver }; | 4 local driver_mt = { __index = driver }; |
| 5 | 5 |
| 6 function driver:open(store, typ) | 6 function driver:open(store, typ) |
| 7 if typ and typ ~= "keyval" then | 7 if typ and typ ~= "keyval" and typ ~= "archive" then |
| 8 return nil, "unsupported-store"; | 8 return nil, "unsupported-store"; |
| 9 end | 9 end |
| 10 return setmetatable({ store = store, type = typ }, driver_mt); | 10 return setmetatable({ store = store, type = typ }, driver_mt); |
| 11 end | 11 end |
| 12 function driver:get(user) | 12 function driver:get(user) |
| 23 | 23 |
| 24 function driver:purge(user) | 24 function driver:purge(user) |
| 25 return true; | 25 return true; |
| 26 end | 26 end |
| 27 | 27 |
| 28 function driver:append() | |
| 29 return nil, "Storage disabled"; | |
| 30 end | |
| 31 | |
| 32 function driver:find() | |
| 33 return function () end, 0; | |
| 34 end | |
| 35 | |
| 28 module:provides("storage", driver); | 36 module:provides("storage", driver); |
