Skip to content

Commit

Permalink
bare jsdoc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
wankdanker committed Oct 6, 2020
1 parent 01f327e commit 9c5139e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ var hostName = process.env.DISCOVERY_HOSTNAME || os.hostname();

module.exports = Network;

/**
*
*
* @param {*} options
* @returns
*/
function Network (options) {
if (!(this instanceof Network)) {
return new Network(options, callback);
Expand Down Expand Up @@ -81,6 +87,11 @@ function Network (options) {

util.inherits(Network, EventEmitter);

/**
*
*
* @param {*} callback
*/
Network.prototype.start = function (callback) {
var self = this;

Expand Down Expand Up @@ -129,6 +140,12 @@ Network.prototype.start = function (callback) {
});
};

/**
*
*
* @param {*} callback
* @returns
*/
Network.prototype.stop = function (callback) {
var self = this;

Expand All @@ -137,6 +154,11 @@ Network.prototype.stop = function (callback) {
return callback && callback();
};

/**
*
*
* @param {*} event
*/
Network.prototype.send = function (event) {
var self = this;

Expand Down Expand Up @@ -174,6 +196,13 @@ Network.prototype.send = function (event) {
});
};

/**
*
*
* @param {*} data
* @param {*} callback
* @returns
*/
Network.prototype.encode = function (data, callback) {
var self = this
, tmp
Expand All @@ -192,6 +221,13 @@ Network.prototype.encode = function (data, callback) {
return callback(null, tmp);
};

/**
*
*
* @param {*} data
* @param {*} callback
* @returns
*/
Network.prototype.decode = function (data, callback) {
var self = this
, tmp
Expand All @@ -212,6 +248,13 @@ Network.prototype.decode = function (data, callback) {
return callback(null, tmp);
};

/**
*
*
* @param {*} str
* @param {*} key
* @returns
*/
function encrypt (str, key) {
var buf = [];
var cipher = crypto.createCipher('aes256', key);
Expand All @@ -222,6 +265,13 @@ function encrypt (str, key) {
return buf.join('');
};

/**
*
*
* @param {*} str
* @param {*} key
* @returns
*/
function decrypt (str, key) {
var buf = [];
var decipher = crypto.createDecipher('aes256', key);
Expand Down

0 comments on commit 9c5139e

Please sign in to comment.