Comparison

plugins/mod_storage_internal.lua @ 6283:7cf6d3a2c855

mod_storage_{none,internal,sql}: Return error for unsupported (everything but keyval) store types
author Kim Alvefur <zash@zash.se>
date Fri, 20 Jun 2014 16:22:23 +0200
parent 5153:688aeac0012a
child 8018:9545d0a9401f
comparison
equal deleted inserted replaced
6282:bce801e40484 6283:7cf6d3a2c855
4 4
5 local driver = {}; 5 local driver = {};
6 local driver_mt = { __index = driver }; 6 local driver_mt = { __index = driver };
7 7
8 function driver:open(store, typ) 8 function driver:open(store, typ)
9 if typ and typ ~= "keyval" then
10 return nil, "unsupported-store";
11 end
9 return setmetatable({ store = store, type = typ }, driver_mt); 12 return setmetatable({ store = store, type = typ }, driver_mt);
10 end 13 end
11 function driver:get(user) 14 function driver:get(user)
12 return datamanager.load(user, host, self.store); 15 return datamanager.load(user, host, self.store);
13 end 16 end