added gcs

This commit is contained in:
Danny Coates 2018-11-02 14:24:10 -07:00
parent 9bb36cd827
commit 53426b950a
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
5 changed files with 4318 additions and 6074 deletions

View file

@ -5,7 +5,14 @@ const createRedisClient = require('./redis');
class DB {
constructor(config) {
const Storage = config.s3_bucket ? require('./s3') : require('./fs');
let Storage = null;
if (config.s3_bucket) {
Storage = require('./s3');
} else if (config.gcs_bucket) {
Storage = require('./gcs');
} else {
Storage = require('./fs');
}
this.log = mozlog('send.storage');
this.expireSeconds = config.expire_seconds;
this.storage = new Storage(config, this.log);