Constructor
(abstract) new StorageProvider(name: string)
Parameters:
Name | Type | Description |
---|---|---|
name |
|
Name of the storage to access. Can be a DB table, file name, etc. Whatever the storage solution expects with regards to providing a unique identifier for a specific storage.
|
- Implements:
- Source:
Methods
.clear() → Promise<void>
Async method that removes all keys and their values from storage
- Implements:
- Source:
.get(key: string) → Promise<string>
Async method that gets the value of a key in storage
Parameters:
Name | Type | Description |
---|---|---|
key |
|
The name of the key in storage |
- Implements:
- Source:
.init() → Promise<void>
Async method to be run that will set up the storage provider for use. Calls to other provider methods should not be made until this method has been called and resolved
- Implements:
- Source:
.keys() → Promise<string[]>
Async method returning an array of stored key names
- Implements:
- Source:
.remove(key: string) → Promise<void>
Async method that removes a key and its value from storage
Parameters:
Name | Type | Description |
---|---|---|
key |
|
The name of the key in storage |
- Implements:
- Source:
.set(key: string, value: string) → Promise<void>
Async method that sets the value of a key in storage
Parameters:
Name | Type | Description |
---|---|---|
key |
|
The name of the key in storage |
value |
|
The value to set in storage |
- Implements:
- Source: