Adding Minio Storage provider

This commit is contained in:
Luis Fernando Molina committed 2019-04-08 09:19:09 +02:00
1 parent d9abf6e445
commit 61f93d82ff
1 file changed
+21 -2
+21 -2
View File
@@ -11,8 +11,10 @@ exports.newBlobStorage = function newBlobStorage(BOT, logger) {
const MODULE_NAME = "Blob Storage";
const SECOND_TRY_WAIT_TIME = 10000;
let AZURE_STORAGE = require('./AzureStorage');
let storage = AZURE_STORAGE.newAzureStorage(bot, logger);
let storage;
let AZURE_STORAGE = require('./AzureStorage')
let MINIO_STORAGE = require('./MinioStorage')
let thisObject = {
initialize: initialize,
@@ -32,6 +34,23 @@ exports.newBlobStorage = function newBlobStorage(BOT, logger) {
try {
switch (process.env.STORAGE_PROVIDER) {
case 'Azure': {
storage = AZURE_STORAGE.newAzureStorage(bot, logger);
break;
}
case 'Minio': {
storage = MINIO_STORAGE.newMinioStorage(bot, logger);
break;
}
default: {
if (ERROR_LOG === true && logger !== undefined) {
logger.write(MODULE_NAME, "[ERROR] initialize -> Storage Provider not supported -> process.env.STORAGE_PROVIDER = " + process.env.STORAGE_PROVIDER); }
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
return;
}
}
containerName = pDataOwner.toLowerCase();
if (pDataOwner.environment !== undefined) { // This is use for data migration from one environment to the other.