Software /
code /
prosody-modules
Changeset
5713:ea6c18ec0669
mod_storage_appendmap: Implement item/user iteration methods
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 05 Nov 2023 21:03:30 +0100 |
parents | 5712:09233b625cb9 |
children | 5714:78f766372e2c |
files | mod_storage_appendmap/mod_storage_appendmap.lua |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_storage_appendmap/mod_storage_appendmap.lua Sun Nov 05 19:22:46 2023 +0100 +++ b/mod_storage_appendmap/mod_storage_appendmap.lua Sun Nov 05 21:03:30 2023 +0100 @@ -97,6 +97,10 @@ return dm.append_raw(user, module.host, self.store, "map", data); end +function map:items() + return dm.users(module.host, self.store, "map"); +end + local keyval = { remove = REMOVE }; local keyval_mt = { __index = keyval }; @@ -109,6 +113,10 @@ return dm.store_raw(dm.getpath(user, module.host, self.store, "map"), data); end +function keyval:users() + return dm.users(module.host, self.store, "map"); +end + -- TODO some kind of periodic compaction thing? function map:_compact(user) local data = self:get(user);