mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-09-12 14:57:19 +00:00
- Rename APIGenericResult to GenericResult - Wrap all provider functions results with GenericResult - Move basic server commands and getters to business logic layer from API on Hetzner
37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import 'package:selfprivacy/logic/api_maps/rest_maps/api_map.dart';
|
|
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
|
export 'package:selfprivacy/logic/api_maps/generic_result.dart';
|
|
|
|
class ProviderApiTokenValidation {
|
|
ProviderApiTokenValidation({
|
|
required this.length,
|
|
required this.regexp,
|
|
});
|
|
final int length;
|
|
final RegExp regexp;
|
|
}
|
|
|
|
abstract class ServerProviderApi extends ApiMap {
|
|
String dnsProviderToInfectName(final DnsProviderType dnsProvider) {
|
|
String dnsProviderType;
|
|
switch (dnsProvider) {
|
|
case DnsProviderType.digitalOcean:
|
|
dnsProviderType = 'DIGITALOCEAN';
|
|
break;
|
|
case DnsProviderType.cloudflare:
|
|
default:
|
|
dnsProviderType = 'CLOUDFLARE';
|
|
break;
|
|
}
|
|
return dnsProviderType;
|
|
}
|
|
|
|
/// Provider name key which lets infect understand what kind of installation
|
|
/// it requires, for example 'digitaloceal' for Digital Ocean
|
|
String get infectProviderName;
|
|
|
|
/// Actual provider name to render on information page for user,
|
|
/// for example 'Digital Ocean' for Digital Ocean
|
|
String get displayProviderName;
|
|
}
|