Software /
code /
prosody
Comparison
plugins/mod_storage_internal.lua @ 8019:925098aad268
mod_storage_internal: Reorder methods
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 31 Mar 2017 17:38:46 +0200 |
parent | 8018:9545d0a9401f |
child | 8020:342ce07836de |
comparison
equal
deleted
inserted
replaced
8018:9545d0a9401f | 8019:925098aad268 |
---|---|
10 return nil, "unsupported-store"; | 10 return nil, "unsupported-store"; |
11 end | 11 end |
12 return setmetatable({ store = store, type = typ }, mt); | 12 return setmetatable({ store = store, type = typ }, mt); |
13 end | 13 end |
14 | 14 |
15 function driver:stores(username) | |
16 return datamanager.stores(username, host); | |
17 end | |
18 | |
19 function driver:purge(user) | |
20 return datamanager.purge(user, host); | |
21 end | |
22 | |
15 local keyval = { }; | 23 local keyval = { }; |
16 driver.keyval = { __index = keyval }; | 24 driver.keyval = { __index = keyval }; |
17 | 25 |
18 function keyval:get(user) | 26 function keyval:get(user) |
19 return datamanager.load(user, host, self.store); | 27 return datamanager.load(user, host, self.store); |
21 | 29 |
22 function keyval:set(user, data) | 30 function keyval:set(user, data) |
23 return datamanager.store(user, host, self.store, data); | 31 return datamanager.store(user, host, self.store, data); |
24 end | 32 end |
25 | 33 |
26 function driver:stores(username) | |
27 return datamanager.stores(username, host); | |
28 end | |
29 | |
30 function keyval:users() | 34 function keyval:users() |
31 return datamanager.users(host, self.store, self.type); | 35 return datamanager.users(host, self.store, self.type); |
32 end | 36 end |
33 | 37 |
34 function driver:purge(user) | |
35 return datamanager.purge(user, host); | |
36 end | |
37 | |
38 module:provides("storage", driver); | 38 module:provides("storage", driver); |