Software /
code /
prosody
Annotate
plugins/mod_storage_none.lua @ 5425:b00812c6daf8
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 05 Apr 2013 10:01:02 +0100 |
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); |