StoragePlugin

StoragePlugin

Description:
  • A plugin that provides read/write access to persistent storage. This is an interface. It is implemented by FPersistStoragePlugin and MongoDBStoragePlugin. You can use one of those or create your own plugin that implements this interface.
Source:
A plugin that provides read/write access to persistent storage. This is an interface. It is implemented by FPersistStoragePlugin and MongoDBStoragePlugin. You can use one of those or create your own plugin that implements this interface.

Methods

(async) clear()

Description:
  • Clear ALL data from storage.
Source:

(async) close()

Description:
  • Finish all operations and close down. Reads and writes may or may not be accepted after this function is called.
Source:

(async) deleteKey(key)

Description:
  • Delete the value associated with the given key, clearing it from persistence. If the key already wasn't present, this won't throw.
Source:
Parameters:
Name Type Description
key String The key.

(async) editValue(key, editFn, defaultValueopt) → {*}

Description:
  • Update the value associated with the given key.
Source:
Parameters:
Name Type Attributes Description
key String The key.
editFn function A (async or sync) function that takes one argument (the current value retrieved from storage for the given key) and returns the updated value.
defaultValue * <optional>
The default value to pass into the editFn if no value is present for that key.
Returns:
The updated value.
Type
*

(async) getValue(key, defaultValueopt) → {*}

Description:
  • Get the value associated with the given key.
Source:
Parameters:
Name Type Attributes Description
key String The key.
defaultValue * <optional>
The default value if no value is present for that key.
Returns:
The value present in storage, or the default value if no value is present in storage.
Type
*