Software /
code /
prosody
Comparison
core/storagemanager.lua @ 5155:a207d4bff5a4
storagemanager: Support for iterating over users
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 21 Sep 2012 17:24:44 +0200 |
parent | 5148:a0b8e5d03de2 |
child | 5502:c773aa4467f1 |
comparison
equal
deleted
inserted
replaced
5154:429c8eeea035 | 5155:a207d4bff5a4 |
---|---|
116 return open(host, datastore):get(username); | 116 return open(host, datastore):get(username); |
117 end | 117 end |
118 function datamanager.store(username, host, datastore, data) | 118 function datamanager.store(username, host, datastore, data) |
119 return open(host, datastore):set(username, data); | 119 return open(host, datastore):set(username, data); |
120 end | 120 end |
121 function datamanager.users(host, datastore, typ) | |
122 local driver = open(host, datastore, typ); | |
123 if not driver.users then | |
124 return function() log("warn", "storage driver %s does not support listing users", driver.name) end | |
125 end | |
126 return driver:users(); | |
127 end | |
121 function datamanager.stores(username, host, typ) | 128 function datamanager.stores(username, host, typ) |
122 return get_driver(host):stores(username, typ); | 129 return get_driver(host):stores(username, typ); |
123 end | 130 end |
124 function datamanager.purge(username, host) | 131 function datamanager.purge(username, host) |
125 return purge(username, host); | 132 return purge(username, host); |