Files
cloudron-box/src/dns/noop.js

73 lines
2.2 KiB
JavaScript
Raw Normal View History

'use strict';
exports = module.exports = {
removePrivateFields: removePrivateFields,
injectPrivateFields: injectPrivateFields,
upsert: upsert,
get: get,
del: del,
wait: wait,
verifyDnsConfig: verifyDnsConfig
};
var assert = require('assert'),
2016-10-08 13:00:40 -07:00
debug = require('debug')('box:dns/noop'),
util = require('util');
function removePrivateFields(domainObject) {
return domainObject;
}
2019-10-23 10:02:04 -07:00
// eslint-disable-next-line no-unused-vars
function injectPrivateFields(newConfig, currentConfig) {
}
function upsert(domainObject, location, type, values, callback) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
2021-05-02 11:26:08 -07:00
assert(Array.isArray(values));
assert.strictEqual(typeof callback, 'function');
debug('upsert: %s for zone %s of type %s with values %j', location, domainObject.zoneName, type, values);
2018-06-29 22:25:34 +02:00
return callback(null);
}
function get(domainObject, location, type, callback) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
assert.strictEqual(typeof callback, 'function');
2016-10-08 14:38:59 -07:00
callback(null, [ ]); // returning ip confuses apptask into thinking the entry already exists
}
function del(domainObject, location, type, values, callback) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
2021-05-02 11:26:08 -07:00
assert(Array.isArray(values));
assert.strictEqual(typeof callback, 'function');
return callback();
}
function wait(domainObject, location, type, value, options, callback) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
assert.strictEqual(typeof value, 'string');
assert(options && typeof options === 'object'); // { interval: 5000, times: 50000 }
assert.strictEqual(typeof callback, 'function');
callback();
}
function verifyDnsConfig(domainObject, callback) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof callback, 'function');
2018-01-09 14:46:38 -08:00
return callback(null, { });
}