add Location class
This commit is contained in:
22
src/location.js
Normal file
22
src/location.js
Normal 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;
|
||||
Reference in New Issue
Block a user