Module: lib/datastores

Module with the datastore abstraction layer to connect with multiple databases

Source:
Tutorials:

Methods

(inner) getMessages(wfQuery, callback)

Get Whiteflag messages from the primary database

Parameters:
Name Type Description
wfQuery Object

the properties of the messages to look up

callback datastoreGetMessagesCb

function to be called upon completion

Source:

(inner) getState(callback)

Gets Whiteflag state from the primary database

Parameters:
Name Type Description
callback datastoreGetStateCb

function to be called upon completion

Source:

(inner) initDatastores(callback)

Initialises configured datastores

Parameters:
Name Type Description
callback datastoreInitCb

function to be called upon completion

Source:

(inner) storeMessage(wfMessage, callback)

Stores Whiteflag messsage in active and enabled datastores

Parameters:
Name Type Description
wfMessage wfMessage

the Whiteflag message to be stored

callback datastoreStoreMessageCb

function to be called upon completion

Source:

(inner) storeState(stateObject, callback)

Stores Whiteflag state in the primary database

Parameters:
Name Type Description
stateObject Object

state data enclosed in a storage / encryption container

callback datastoreStoreStateCb

function to be called upon completion

Source:

Type Definitions

datastoreCloseCb(callback)

Closes configured datastores

Parameters:
Name Type Description
callback datastoreCloseCb

function to be called upon completion

Source:

datastoreGetMessagesCb(err, wfMessages, count)

Callback after retrieving Whiteflag messages

Parameters:
Name Type Description
err Error

error object if any error

wfMessages Array

the resulting Whiteflag messages

count number

the number of messages found

Source:

datastoreGetStateCb(err, stateObject)

Callback after getting the Whiteflag state

Parameters:
Name Type Description
err Error

error object if any error

stateObject Object

state data enclosed in a storage / encryption container

Source:

datastoreInitCb(err)

Callback after initialising the datastore

Parameters:
Name Type Description
err Error

error object if any error

Source:

datastoreInitCb(err)

Callback after closing the datastore

Parameters:
Name Type Description
err Error

error object if any error

Source:

datastoreStoreMessageCb(err, result)

Callback after storing the Whiteflag message

Parameters:
Name Type Description
err Error

error object if any error

result *

the result

Source:

datastoreStoreStateCb(err, result)

Callback after storing the Whiteflag state

Parameters:
Name Type Description
err Error

error object if any error

result *

the result

Source:

rxStoreMessageDbCb(err, storedMessage)

Transmits result of storage of received message

Parameters:
Name Type Description
err Error

error object if any error

storedMessage wfMessage

the stored Whiteflag message

Source:

txStoreMessageDbCb(err, storedMessage)

Transmits result of storage of sent message

Parameters:
Name Type Description
err Error

error object if any error

storedMessage wfMessage

the stored Whiteflag message

Source: