diff mod_storage_appendmap/mod_storage_appendmap.lua @ 5690: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 e44b868cc575
children 78f766372e2c
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);