Make RadiusServer singleton

This commit is contained in:
Garrett Mills 2021-10-25 10:42:49 -05:00
parent 9c7380a94f
commit 05278bda0c

View File

@ -6,8 +6,21 @@ import { RadiusService } from './RadiusService';
const packageInterface = PackageInterface.get();
export class RadiusServer {
private static instance?: RadiusServer;
public static get(): RadiusServer {
if (!this.instance) {
this.instance = new this();
}
return this.instance;
}
private server?: UDPServer;
// eslint-disable-next-line @typescript-eslint/no-empty-function
private constructor() {}
public async up(): Promise<void> {
const config = packageInterface.getConfig();
const AuthMechanismus = (await import(`../auth/${config.authentication}`))[