pig-dam-cfg
Version:
Pig DAM's configuration information server
26 lines (25 loc) • 772 B
JavaScript
;
/**
* Date: 6/12/20
* Time: 11:16 PM
* @license MIT (see project's LICENSE file)
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServiceConfiguration = exports.getClusterConfiguration = void 0;
const manifest_1 = require("./manifest");
/**
* Gets the entire cluster's configuration
* @throws {Error}
*/
function getClusterConfiguration(manifest = manifest_1.getClusterManifest()) {
return manifest.cluster;
}
exports.getClusterConfiguration = getClusterConfiguration;
/**
* Loads the configuration of the specified service
* @throws {Error}
*/
function getServiceConfiguration(service, cluster = getClusterConfiguration()) {
return cluster[service];
}
exports.getServiceConfiguration = getServiceConfiguration;