Storage mechanisms are one of two exported storage APIs. Storage mechanisms
are groups of storage cells (shakaExtern.StorageCell). Storage mechanisms
are responsible for managing the life cycle of resources shared between
storage cells in the same block.
For example, a storage mechanism may manage a single database connection
while each cell would manage different tables in the database via the same
connection.
- Implementations:
- Source:
Methods
destroy() → (non-null) {Promise}
Free all resources used by the storage mechanism and its cells. This should
not affect the stored content.
- Source:
Returns:
- Type
- Promise
erase() → (non-null) {Promise}
Erase all content from storage and leave storage in an empty state. It is
expected that |erase| will be called after |init| and will still be
initialized for use after calling |erase|.
- Source:
Returns:
- Type
- Promise
getCells() → (non-null) {Object.<string, !shakaExtern.StorageCell>}
Get a map of all the cells managed by the storage mechanism. Editing the map
should have no effect on the storage mechanism. The map key is the cell's
address in the mechanism and should be consistent between calls to
|getCells|.
- Source:
Returns:
- Type
- Object.<string, !shakaExtern.StorageCell>
init() → (non-null) {Promise}
Initialize the storage mechanism for first use. This should only be called
once. Calling |init| multiple times has an undefined behaviour.
- Source:
Returns:
- Type
- Promise