new Cache()
The data cache.
This is just a dummy implementation that could be overriden by a plugguble module.
Methods
add(key, value, cb)
Add to cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The cache key |
value |
string | object | array | The value to cache |
cb |
Cache~addCallback | The callback function |
get(key, cb)
Get from cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The cache key |
cb |
Cache~getCallback | The callback function |
getKeys(key, cb)
Get the cache keys.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | A prefix key |
cb |
Cache~getKeysCallback | The callback function |
purge(key, cb)
Purge from cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The cache key |
cb |
Cache~purgeCallback | The callback function |
Type Definitions
addCallback(err, res)
Parameters:
Name | Type | Description |
---|---|---|
err |
object | The exception object |
res |
object | The cached results |
getCallback(err, res)
Parameters:
Name | Type | Description |
---|---|---|
err |
object | The exception object |
res |
object | The cached results |
getKeysCallback(err, res)
Parameters:
Name | Type | Description |
---|---|---|
err |
object | The exception object |
res |
object | The result keys |
purgeCallback(err, res)
Parameters:
Name | Type | Description |
---|---|---|
err |
object | The exception object |
res |
object | The results |