How to use the jsprim.mergeObjects function in jsprim

To help you get started, we’ve selected a few jsprim examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joyent / sdc-docker / lib / wfapi / index.js View on Github external
Wfapi.prototype.createPushImageJob = function (options, cb) {
    var self = this;
    assert.object(options, 'options');
    assert.string(options.account_uuid, 'opts.account_uuid');
    assert.object(options.image, 'options.image');
    assert.optionalString(options.regAuth, 'opts.regAuth');
    assert.string(options.repoAndTag, 'options.repoAndTag');
    assert.string(options.req_id, 'options.req_id');

    // Combine the push opts and the workflow opts.
    var params = jsprim.mergeObjects(options, {
        target: format('/push-image-%s', options.repoAndTag),
        task: 'push-image'
    });

    var jobOpts = { headers: { 'x-request-id': options.req_id } };

    self.client.createJob(params.task, params, jobOpts, function (err, job) {
        if (err) {
            return cb(err);
        }
        params.job_uuid = job.uuid;
        self.log.debug(params, 'Push image => job params');
        return cb(null, job.uuid);
    });
};
github joyent / moray / lib / server.js View on Github external
{
                    address: '0.0.0.0',
                    port: 1234
                }
            ]
        });
    } else {
        dbopts = options.manatee;
        dbdomain = options.service_name || 'manatee';
        dbopts.manatee.log = log;
        dbresolver = mod_manatee.createPrimaryResolver(dbopts.manatee);
    }

    dbresolver.start();

    var db = pg.createPool(mod_jsprim.mergeObjects(dbopts.pg, {
        log: log,
        url: dbopts.url,
        domain: dbdomain,
        collector: collector,
        resolver: dbresolver
    }));

    /*
     * Collect connection pool information when metrics are scraped.
     */
    collector.addTriggerFunction(function (_, cb) {
        db.getPoolStats();
        setImmediate(cb);
    });

    this.ms_bucketCache = new LRU({
github joyent / manatee / lib / postgresMgr.js View on Github external
PostgresMgr.prototype._updatePgConf = function (updates, cb) {
    var options =
        mod_jsprim.mergeObjects(updates, null, this._additionalPgOptions);
    this._updateConf(options, this._postgresConf, this._postgresConfPath, cb);
};
github joyent / moray / pg-setup.js View on Github external
dbresolver.once('added', function (_, primary) {
        var collector = mod_artedi.createCollector({ labels: {} });
        var db = mod_pg.createPool(mod_jsprim.mergeObjects(dbopts.pg, {
            log: LOG,
            domain: 'manatee',
            user: 'postgres',
            collector: collector,
            resolver: dbresolver
        }));

        setupPostgres({
            resolver: dbresolver,
            primary: primary,
            config: config,
            db: db
        }, function (err) {
            db.close();

            if (err) {
github joyent / dragnet / lib / stream-util.js View on Github external
function streamOptions(useroptions, overrides, defaults)
{
	return (mod_jsprim.mergeObjects(useroptions, overrides, defaults));
}