2020-04-08 16:27:34 +02:00
|
|
|
class Provider {
|
|
|
|
|
2020-04-11 21:16:37 +02:00
|
|
|
constructor(manager, config, name) {
|
2020-04-08 18:08:46 +02:00
|
|
|
|
|
|
|
if(!config) throw new Error('No config file provided!');
|
2020-04-11 21:16:37 +02:00
|
|
|
this.config = config[name];
|
|
|
|
if(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.db;
|
|
|
|
this.loaded = false;
|
2020-04-11 21:16:37 +02:00
|
|
|
this.name = name;
|
2020-04-08 18:08:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-04-08 16:27:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Provider;
|