add Location class

This commit is contained in:
Girish Ramakrishnan
2023-08-17 10:44:07 +05:30
parent de7879afb5
commit 3d0ba557e5
4 changed files with 38 additions and 18 deletions

22
src/location.js Normal file
View File

@@ -0,0 +1,22 @@
'use strict';
class Location {
constructor(subdomain, domain, type, certificate) {
this.subdomain = subdomain;
this.domain = domain;
this.type = type;
this.certificate = certificate || null;
this.fqdn = domain ? (subdomain + (subdomain ? '.' : '') + domain) : '';
}
}
// subdomain (table) types
Location.TYPE_PRIMARY = 'primary';
Location.TYPE_SECONDARY = 'secondary';
Location.TYPE_REDIRECT = 'redirect';
Location.TYPE_ALIAS = 'alias';
Location.TYPE_DASHBOARD = 'dashboard';
Location.TYPE_MAIL = 'mail';
Location.TYPE_DIRECTORY_SERVER = 'directoryserver';
exports = module.exports = Location;