Global

Members

(constant) IPC

Description:
  • Entry point for child_process.fork to run a corresponding resource / job.

Source:

Entry point for child_process.fork to run a corresponding resource / job.

length

Description:
  • Get current batch buffer length

Source:

Get current batch buffer length

total

Description:
  • Get current batch buffer length

Source:

Get current batch buffer length

Methods

clearTaskRecord(taskId) → {Promise}

Description:
  • clear task record in db with task id

Source:
Parameters:
Name Type Description
taskId string

the id of task in db.

Returns:

promise - Promise object

Type
Promise

create(params) → {Object}

Description:
  • Event Groups CRUD - The function creating to make a new event groups data.

Source:
Parameters:
Name Type Description
params Object

params

Returns:
Type
Object

debounce(func, minWait, maxWait) → {function}

Description:
  • Debounce function which decreases number of calls to func to be once in minWait ... maxWait.

Source:
Parameters:
Name Type Description
func function

function to debounce

minWait number

minimal waiting time

maxWait number

maximal waiting time

Returns:

debounced function

Type
function

dig(config, over, name, value) → {object}

Description:
  • Digs one level down in config document

Source:
Parameters:
Name Type Description
config object

config to traverse

over object

override object

name string

name of config to override

value varies

value to set to config

Returns:

recursive config modification

Type
object

discoverLeader()

Description:
  • Leader discovery & taking leadership

Source:

dot(obj, is, value) → {varies}

Description:
  • Get value in nested objects

Source:
Parameters:
Name Type Description
obj object

object to checl

is string | array

keys for nested value

value any

if provided acts as setter setting this value in nested object

Returns:

returns value in provided key in nested object

Type
varies

flush(ignore_codes)

Description:
  • Flush the buffer by inserting documents into collection

Source:
Parameters:
Name Type Description
ignore_codes Array.<number>

error codes to ignore

fromCountlyRoot(relativePath) → {string}

Description:
  • Resolves the given relative path to absolute from Countly repository root path.

Source:
Parameters:
Name Type Description
relativePath string

The path relative to Countly root directory.

Returns:

The absolute path resolved for the given relative path.

Type
string

getCountryName(cc) → {string}

Description:
  • Convert short country name to proper name

Source:
Parameters:
Name Type Description
cc string

short country name, for example, Trinidad

Returns:

normal country name

Type
string

getId() → {string}

Description:
  • Generate random id

Source:
Returns:

randomly generated id

Type
string

handleRequest(req, res)

Description:
  • Handle incoming HTTP/HTTPS requests

Source:
Parameters:
Name Type Description
req http.IncomingMessage

The request object

res http.ServerResponse

The response object

imAlive(callback)

Description:
  • Update last seen

Source:
Parameters:
Name Type Description
callback function

to call when done

periodic()

Description:
  • Periodic function to be run each second on each server

Source:

promiseOrCallback(promise, callbackopt) → {Promise}

Description:
  • Return promise or callback based on params

Source:
Parameters:
Name Type Attributes Description
promise Promise

promise for data

callback function <optional>

callback to call

Returns:

Returned promise

Type
Promise

pushAsync(record)

Description:
  • Async push, that is if we're ok with a promise per insert

Source:
Parameters:
Name Type Description
record object

document to insert

pushSync(record) → {boolean}

Description:
  • Sync push, that is if we're NOT ok with a promise per insert

Source:
Parameters:
Name Type Description
record object

document to insert

Returns:

true if buffer needs to be flush()ed

Type
boolean

random() → {string}

Description:
  • Return random string

Source:
Returns:

random string

Type
string

(async) remove(params)

Description:
  • Event Groups CRUD - The function deleting which created Event Groups data by _id

Source:
Parameters:
Name Type Description
params Object

setup()

Description:
  • Initial setup: insert this server document into db

Source:

update(params)

Description:
  • Event Groups CRUD - The function updating which created Event Groups data by _id

Source:
Parameters:
Name Type Description
params Object

(async) uploadFormFile(url, fileData, callback)

Description:
  • Uploads a file to the server

Source:
Parameters:
Name Type Description
url string

url to upload file to

fileData object

file data object

Properties
Name Type Description
fileField string

name of the field to upload file as

fileStream string

file stream to upload

callback function

callback function