All files / mesos-framework/lib mesos.js

93.33% Statements 14/15
100% Branches 2/2
80% Functions 4/5
93.33% Lines 14/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59    1x 1x     1x     1x                 20x 9x                 1x 9x             1x 1x               1x               1x 1x     1x  
"use strict";
 
var protoBuf = require("protobufjs");
var path = require("path");
 
// Load Mesos protobuf definitions
var builder = protoBuf.loadProtoFile(path.join(__dirname, "../", "proto/all.proto"));
 
// Instantiate protobuf definitions
var mesos = builder.build("mesos");
 
/**
 * The Mesos protocol buffers helper
 * @returns {object} An object with the Mesos protocol buffer definitions
 * @constructor
 */
function Mesos () {
 
    if (!(this instanceof Mesos)) {
        return new Mesos();
    }
 
}
 
/**
 *
 * @returns {Mesos}
 */
Mesos.prototype.getMesos = function () {
    return mesos;
};
 
/**
 * Get a ProtoBuf.Builder instance
 * @returns {?ProtoBuf.Builder|undefined|ProtoBuf.Builder} A ProtoBuf.Builder instance
 */
Mesos.prototype.getBuilder = function () {
    return builder;
};
 
/**
 * Convenience method to get a ProtoBuf.Message instance of the specified `messageType`
 * @param {string} messageType The
 * @returns {?ProtoBuf.Message|undefined|ProtoBuf.Message} A ProtoBuf.Message instance
 */
Mesos.prototype.build = function (messageType) {
    return new (builder.build(messageType))()
};
 
/**
 * Get a reference to the protobuf.js module
 * @returns {function} A reference to the protobuf.js module
 */
Mesos.prototype.getProtoBuf = function () {
    return protoBuf;
};
 
module.exports = Mesos;