Software /
code /
prosody
Annotate
plugins/mod_storage_none.lua @ 7097:5a71aaa2c542
server_select: Add logging of when servers are paused and resumed
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 22 Jan 2016 02:00:43 +0100 |
parent | 5425:b00812c6daf8 |
child | 6283:7cf6d3a2c855 |
rev | line source |
---|---|
5425
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 local driver = {}; |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 local driver_mt = { __index = driver }; |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 function driver:open(store) |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 return setmetatable({ store = store }, driver_mt); |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 end |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 function driver:get(user) |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 return {}; |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 end |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 function driver:set(user, data) |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 return nil, "Storage disabled"; |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 end |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 function driver:stores(username) |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 return { "roster" }; |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 end |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 function driver:purge(user) |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 return true; |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 end |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 |
b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 module:provides("storage", driver); |