mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 08:48:32 +01:00
23 lines
511 B
JavaScript
23 lines
511 B
JavaScript
const QueryRunner = require('./QueryRunner');
|
|
|
|
let singleton = null;
|
|
|
|
class Gamedig {
|
|
constructor(runnerOpts) {
|
|
this.queryRunner = new QueryRunner(runnerOpts);
|
|
}
|
|
|
|
async query(userOptions) {
|
|
return await this.queryRunner.run(userOptions);
|
|
}
|
|
|
|
static getInstance() {
|
|
if (!singleton) singleton = new Gamedig();
|
|
return singleton;
|
|
}
|
|
static async query(...args) {
|
|
return await Gamedig.getInstance().query(...args);
|
|
}
|
|
}
|
|
|
|
module.exports = Gamedig;
|