@team-supercharge/nest-amqp
Version:
AMQP 1.0 module for Nest framework
38 lines (37 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AMQConnectionOptionsStorage = void 0;
class AMQConnectionOptionsStorage {
/**
* Add Queue Module Options to storage for connection
*
* @param {string} name Name of the connection, will be used as key
* @param {Options} options The options object
*/
static add(name, options) {
this.storage.set(name, options);
}
/**
* Retreive stored from storage for connection
*
* @param {string} name Name of the connection
*
* @returns {Options | null} The stored connection or null
*/
static get(name) {
if (!name) {
return null;
}
return this.storage.get(name) || null;
}
/**
* Get all connection keys
*
* @returns {string[]}
*/
static getKeys() {
return Array.from(this.storage.keys());
}
}
exports.AMQConnectionOptionsStorage = AMQConnectionOptionsStorage;
AMQConnectionOptionsStorage.storage = new Map();