Extends
Members
(static) dependencies :Array.<string>
Class dependencies:
['driver.config', 'helper.date']
.
config :object.<string, *>
Current driver configuration data.
dateHelper :support.helpers.DateHelper
Date helper.
engine :*
- Source:
- Inherited From:
Current engine accessor.
Methods
(abstract) get(key, defaultValueopt)
Retrieve an item from the cache by key.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | The cache key. | |
defaultValue |
* |
<optional> |
The default value. |
Returns:
The cached value.
- Type
- Promise.<*>
(async, abstract) put(key, value, secondsopt)
Insert an item in the cache with key and expiration delay.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | The cache key. | |
value |
* | The value to cache. | |
seconds |
number |
<optional> |
The cache expiration delay, in seconds. |
Returns:
The async process promise.
- Type
- Promise
(async, abstract) forever(key, value)
Insert an item in the cache with key forever, without expiration.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The cache key. |
value |
* | The value to cache. |
Returns:
The async process promise.
- Type
- Promise
(async, abstract) increment(key, incrementopt)
Increment an item in cache.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string | The cache key. | ||
increment |
number |
<optional> |
1
|
The increment value to add to the cached entry. |
Returns:
The async process promise.
- Type
- Promise
(async, abstract) decrement(key, decrementopt)
Decrement an item in cache.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string | The cache key. | ||
decrement |
number |
<optional> |
1
|
The decrement value to substract from the cached entry. |
Returns:
The async process promise.
- Type
- Promise
(async, abstract) delete(key)
Delete an item in the cache by key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The cache key. |
Returns:
The async process promise.
- Type
- Promise
(async, abstract) flush()
Delete all items the cache.
Returns:
The async process promise.
- Type
- Promise
now()
Get current time in seconds.
Returns:
The current unix timestamp.
- Type
- number
setEngine(engine)
- Source:
- Inherited From:
Set current engine.
Parameters:
Name | Type | Description |
---|---|---|
engine |
* | The engine instance. |
Returns:
The current instance.