selfprivacy.org.app/lib/logic/providers/dns_providers/dns_provider.dart

38 lines
1.3 KiB
Dart

import 'package:selfprivacy/logic/api_maps/generic_result.dart';
import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/desired_dns_record.dart';
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
import 'package:selfprivacy/logic/models/json/dns_records.dart';
export 'package:selfprivacy/logic/api_maps/generic_result.dart';
abstract class DnsProvider {
DnsProviderType get type;
Future<GenericResult<bool>> tryInitApiByToken(final String token);
Future<GenericResult<String?>> getZoneId(final String domain);
Future<GenericResult<void>> removeDomainRecords({
required final ServerDomain domain,
final String? ip4,
});
Future<GenericResult<List<DnsRecord>>> getDnsRecords({
required final ServerDomain domain,
});
Future<GenericResult<void>> createDomainRecords({
required final ServerDomain domain,
final String? ip4,
});
Future<GenericResult<void>> setDnsRecord(
final DnsRecord record,
final ServerDomain domain,
);
Future<GenericResult<List<String>>> domainList();
Future<GenericResult<List<DesiredDnsRecord>>> validateDnsRecords(
final ServerDomain domain,
final String ip4,
final String dkimPublicKey,
);
List<DesiredDnsRecord> getDesiredDnsRecords(
final String? domainName,
final String? ip4,
final String? dkimPublicKey,
);
}