util/memcache.lua

changeset 0
73bc20975514
child 13
db66a09dc0b6
equal deleted inserted replaced
-1:000000000000 0:73bc20975514
1
2 module("memcache", package.seeall);
3
4 function new()
5 local cache = {};
6
7 local _data = {};
8 local _flags = {};
9
10 function cache:set(key, flags, expires, data)
11 if expires ~= 0 then
12 return false, "Expiry is not currently implemented";
13 end
14 _flags[key] = flags;
15 _data[key] = data;
16 return true;
17 end
18
19 function cache:get(key)
20 return _flags[key], _data[key];
21 end
22
23 return cache;
24 end
25
26 return _M;

mercurial