plugins/mod_storage_none.lua
author Matthew Wild <mwild1@gmail.com>
Mon, 22 Apr 2013 12:24:42 +0100
changeset 5503 91052e59375c
parent 5425 b00812c6daf8
child 6283 7cf6d3a2c855
permissions -rw-r--r--
net.server.http: Ensure that event map cannot grow forever (limit to 10K wildcard-only entries)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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);