forked from kuja/hamster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache.js
More file actions
35 lines (31 loc) · 705 Bytes
/
Copy pathcache.js
File metadata and controls
35 lines (31 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module.exports = Cache
/**
* @exports Cache as hamster.cache.Cache
* @constructor
*/
function Cache() {}
/**
* Get current time as UNIX timestamp.
*
* @return {Number} Current timestamp
*/
Cache.prototype.getCurrentTime = function () {
return (new Date()).getTime()
}
/**
* Store value in cache.
*
* @param {String} key Cache key
* @param {String} value Cache Value
* @param {Number} duration Number of seconds this cache entry will live
* @param {Function} cb Callback
*/
Cache.prototype.write
/**
* Retrieve value from cache.
*
* @param {String} key Cache key
* @param {Function} cb Callback
* @return {String} Cache value
*/
Cache.prototype.read