/mesos-dns-node-resolver

A small library to resolve records in Mesos DNS (via SRV DNS records) for Node.js.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

mesosdns-node-resolver

Package version Package downloads Package license Build Status NSP Status

A small library to resolve records in Mesos DNS (via SRV DNS records) for Node.js.

Dependencies:

None at runtime

Usage

Parameters:

  • serviceName - a service name to resolve, the suffix will be added to it unless it ends with a dot
  • suffixZones - The number of zones in the suffix (defaults to 2, optional)
  • suffix - the DNS suffix (defaults to marathon.mesos)
  • callback - A function that gets err and result (array of object with host property and a sorted ports array)
mesosdns = require("mesosdns-node-resolver");
mesosdns.resolve("service.group", function (err, result) {
  console.log(result);
});

To use promises call promiseResolve without a callback.