galactic-bot/storage/Provider.js

22 lines
516 B
JavaScript
Raw Normal View History

2020-04-08 16:27:34 +02:00
class Provider {
constructor(manager, opts) {
2020-04-08 18:08:46 +02:00
if(!opts.config) throw new Error('No config file provided!');
this.config = opts.config[opts.name];
if(this.config && (!this.config.database || !this.config.host)) throw new Error('Invalid config file provided!' + JSON.stringify(this.config));
2020-04-08 18:08:46 +02:00
this.manager = manager;
this.name = opts.name;
this.connection = null;
this.db = null;
this._initialized = false;
2020-04-08 18:08:46 +02:00
}
2020-04-08 16:27:34 +02:00
}
module.exports = Provider;