softplayer-web/lib/helpers/providers/hetzner.dart

54 lines
1.8 KiB
Dart

import 'package:softplayer_dart_proto/environments/environments_v1.pbgrpc.dart';
import 'package:softplayer_web/helpers/providers/common.dart' as helper;
class Hetzner implements helper.Provider {
@override
String getProviderName() {
return "Hetzner";
}
@override
String rawProviderName() {
return Provider.PROVIDER_HETZNER.toString();
}
@override
String getServerLocation(String serverType) {
if (serverType == Location.LOCATION_HETZNER_ASHBURN.toString()) {
return "Ashburn, USA";
} else if (serverType == Location.LOCATION_HETZNER_FALKENSTEIN.toString()) {
return "Falkenstein, Germany";
} else if (serverType == Location.LOCATION_HETZNER_HELSINKI.toString()) {
return "Helsinki, Finland";
} else if (serverType == Location.LOCATION_HETZNER_HILLSBORO.toString()) {
return "Hillsboro, USA";
} else if (serverType == Location.LOCATION_HETZNER_NUREMBERG.toString()) {
return "Nuremberg, Germany";
} else {
throw 'Unknown server type';
}
}
@override
String rawServerLocation(String serverLocation) {
if (serverLocation == "Ashburn, USA") {
return Location.LOCATION_HETZNER_ASHBURN.toString();
} else if (serverLocation == "Falkenstein, Germany") {
return Location.LOCATION_HETZNER_FALKENSTEIN.toString();
} else if (serverLocation == "Helsinki, Finland") {
return Location.LOCATION_HETZNER_HELSINKI.toString();
} else if (serverLocation == "Hillsboro, USA") {
return Location.LOCATION_HETZNER_HILLSBORO.toString();
} else if (serverLocation == "Nuremberg, Germany") {
return Location.LOCATION_HETZNER_NUREMBERG.toString();
} else {
throw 'Unknown server type';
}
}
@override
String defaultLocation() {
return Location.LOCATION_HETZNER_NUREMBERG.toString();
}
}