new eFTLKVMap(name)
A key-value map object allows setting, getting, and removing key-value pairs in an FTL map.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The key-value map name. |
Methods
-
get(key, options)
-
Get a key-value pair from the map.
Parameters:
Name Type Description key
string Get the value for this key. options
object A JavaScript object holding key-value map callbacks. Properties
Name Type Argument Description onSuccess
eFTLKVMap~onSuccess <optional>
Process success. onError
eFTLKVMap~onError <optional>
Process errors. -
remove(key, options)
-
Remove a key-value pair from the map.
Parameters:
Name Type Description key
string Remove the value for this key. options
object A JavaScript object holding key-value map callbacks. Properties
Name Type Argument Description onSuccess
eFTLKVMap~onSuccess <optional>
Process success. onError
eFTLKVMap~onError <optional>
Process errors. -
set(key, message, options)
-
Set a key-value pair in the map, overwriting any existing value.
Parameters:
Name Type Description key
string Set the value for this key. message
eFTLMessage Set this value for the key. options
object A JavaScript object holding key-value map callbacks. Properties
Name Type Argument Description onSuccess
eFTLKVMap~onSuccess <optional>
Process success. onError
eFTLKVMap~onError <optional>
Process errors.
Type Definitions
-
onError(key, message, errorCode, reason)
-
An error prevented a key-value map operation.
Parameters:
Name Type Description key
string The key being operated upon. message
eFTLMessage The value of the key. errorCode
object A code categorizes the error. Your program can use this value in its response logic. reason
string This string provides more detail. Your program can use this value in error reporting and logging. -
onSuccess(key, message)
-
A key-value map operation has completed successfully.
Parameters:
Name Type Description key
string The key being operated upon. message
eFTLMessage The value of the key.