cachedo
v1.0.0
Published
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Downloads
4
Readme
Table of Contents
CacheDo
Cache abstraction that supports merging cached values with new and key hashing
Parameters
cacheClass
Class Caching class with get, put, del methodsoptions
JSON Class operation definitionoptions.merge
Boolean (false) Enable/Disable merging new value with present value if one existsoptions.keys
JSON Defines options specific to key managementoptions.ttl
Number (600) Define expire time of the cached valueoptions.timeoutCB
(Undefined | Function) (Undefined) Custom callback function to be executed when cache value expires
Meta
- version: 1.0.0
setCache
Validates caching function by ensuring that it contains methods get, put, del
Parameters
cacheClass
Function Caching function
setOptions
Merges and returns a validated option set
Parameters
options
JSON Class operation definitionoptions.merge
Boolean (false) Enable/Disable merging new value with present value if one existsoptions.keys
JSON Defines options specific to key managementoptions.ttl
Number (600) Define expire time of the cached valueoptions.timeoutCB
(Undefined | Function) (Undefined) Custom callback function to be executed when cache value expires
hashKey
Produces hash of parameter.
Parameters
setKet
Generates key based on configuration settings
Parameters
put
Pushes key/value pair to cache
Parameters
key
Stringvalue
(Number | String | JSON) Value to be cachedoptions
JSON Optional options passed that will override options used during class instantiation
get
Calls cache to return value assigned to key
Parameters
key
String