Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WhoisDns File #142

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Avi-kheni
Copy link

@Avi-kheni Avi-kheni commented Jan 17, 2024

Add WhoisDnsModel file

Closes #140

Add WhoisDnsModel file
import StoreKit
import SwiftyStoreKit

final class WhoisDns: DataFeedSingleton {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to SwiftWhois? DNS == Domain Name System

public static var lookupService: IPLookupService = .init()

class IPLookupService: Service {
var name: String = "Simple IP Lookup"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var name: String = "Simple IP Lookup" -> var name: String = "Simple Whois Lookup"

return
}

DNSResolver.resolve(host: host) { error, addresses in
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

@twodayslate twodayslate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove DnsResolver from FreeSwiftWhois class
Add  SwiftWhois.lookup in FreeSwiftWhois query metod
Remove Addresss array from  FreeSwiftWhois Model and response model for whoisData
Create Codeable Model For WhoisData
Pass whoisData into Content Model
@@ -5,6 +5,7 @@ import Foundation
import KeychainAccess
import StoreKit
import SwiftyStoreKit
import SwiftWhois
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this line

@@ -45,6 +46,9 @@ extension LocalDns: DataFeedService {
return
}

do {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this block

throw URLError(.badURL)
}

return try await withCheckedThrowingContinuation { continuation in
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

}

return try await withCheckedThrowingContinuation { continuation in
Task {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

import SwiftWhois


struct FreeSwiftWhoisDataModel: Codable {
Copy link
Owner

@twodayslate twodayslate Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? Let's make the actual content Codable

let copyData = try JSONEncoder().encode(dataModel)
latestData = copyData
dataToCopy = String(data: copyData, encoding: .utf8)
content.append(.row(title: "Domain", content: dataModel.domainName ?? ""))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the data is missing let's just not display it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use free whois information
2 participants