Abstract
The type of the data to store and retrieve.
The type of the data to serialize and deserialize.
Creates a new instance of the StorageDriver
class.
The name of the storage driver.
The serializer to use for serializing and deserializing data.
If driver does not support onUpdate, use this to notify with external event.
Optional
processor: Loadable<IStoreProcessor<Output>>The store processor to use for processing data before it is written to storage and after it is loaded from storage.
Optional
logger: ILoggerLikeThe logger to use for logging messages.
Abstract
Readonly
bandwidthIndicates the speed of the storage driver.
Readonly
loggerReadonly
nameThe name of the storage driver.
Readonly
serializerIndicates whether or not the storage driver has been initialized.
Clear the stored data
Clear the stored data and return the Promise of Result.
A promise of Result that resolves when the data has been successfully cleared.
Retrieves the processor for the storage driver if it is available.
The processor for the storage driver, or undefined
if no processor is available.
Retrieves the processor for the storage driver if it is available and returns the Promise of Result.
The processor for the storage driver, or undefined
if no processor is available.
Get the serializer for the storage driver.
The serializer for the storage driver.
Protected
Abstract
handleClear the stored data in storage.
A promise that resolves when the data has been successfully cleared.
Protected
Abstract
handleProtected
Abstract
handleInitialize the storage driver.
A promise that resolves to true
if the storage driver was successfully initialized, or false
otherwise.
Protected
Abstract
handleStore the given data to storage.
The data to store.
A promise that resolves when the data has been successfully stored.
Protected
Abstract
handleCalled when the storage driver is unloaded.
A promise that resolves to true
if the storage driver was successfully unloaded, or false
otherwise.
Protected
handleUse this to indicate that the data has been updated.
Retrieves the data stored using the specified key.
The options to use for hydrating the data.
The retrieved data, or undefined
if no data was found.
Retrieves the data stored using the specified key and returns the Promise of Result.
Optional
options: IHydrateOptionsThe options to use for hydrating the data.
Promise of Result that resolves to the retrieved data, or undefined
if no data was found.
Initializes the storage driver.
A promise that resolves to true
if the storage driver was successfully initialized, or false
otherwise.
Initializes the storage driver and returns the Promise of Result.
Promise of the result object, see Result
Stores the given data using the specified key.
The data to store.
Stores the given data using the specified key and returns the Promise of Result.
The data to store.
A promise of Result that resolves when the data has been successfully stored.
Build the default JSON representation of the storage driver.
The JSON representation of the storage driver.
Returns a string representation of an object.
Unload the storage driver.
A promise that resolves to true
if the storage driver was successfully unloaded, or false
otherwise.
Unload the storage driver and return the Promise of Result.
A promise of Result that resolves to true
if the storage driver was successfully unloaded, or false
otherwise.
Abstract class that provides a simple interface for storing and retrieving data using a specified storage mechanism.
Since
v0.11.0