Skip to content

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
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

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