Class wink.cache.indexedDatabase
Manage the data storage in indexed Database
- Defined in: wink.cache.indexedDatabase.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
wink.cache.indexedDatabase(properties)
|
Method Summary
Class Detail
wink.cache.indexedDatabase(properties)
Author: Donatien LEBARBIER.
- Parameters:
- {object} properties
- The properties object
- {string} properties.dbName
- The name of the database
- {string} properties.dbTable
- The name of the resource table
Method Detail
-
deleteResource(url, callback, errCallback)Delete a resource from storage
- Parameters:
- {string} url
- Url of the resource to delete
- {function} callback
- Function called on success
- {function} errCallback
- Function called on error
-
drop(callback, errCallback)Drop the data
- Parameters:
- {function} callback
- Function called on success
- {function} errCallback
- Function called on error
-
endTransaction()Action to execute at the end of a transaction
-
getExpiredItems(callback, errCallback, urls)Retrieve the expired resources and the resources no more used (synchronization)
- Parameters:
- {function} callback
- Function called on success
- {function} errCallback
- Function called on error
- {array} urls
- List of resources url (useful for synchronization)
-
getItem(url, callback, errCallback)Retrieve a resource by its url from storage
- Parameters:
- {string} url
- Url of the resource to retrieve
- {function} callback
- Function called on success
- {function} errCallback
- Function called on error
-
{boolean} isSupported()Test if browser supports indexedDatabase
- Returns:
- {boolean} Whether this type of storage is supported
-
open(callback, errCallback)Open and initialize storage if not done
- Parameters:
- {function} callback
- Function called on success
- {function} errCallback
- Function called on error
-
storeResource(url, type, version, expires, data, callback, errCallback)Store a resource in storage
- Parameters:
- {string} url
- {string} type
- {number} version
- {number} expires
- {string} data
- {function} callback
- Function called if success
- {function} errCallback
- Function called if error