You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/SessionSnodeKit/Networking/Destination.swift

26 lines
693 B
Swift

// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
//
// stringlint:disable
import Foundation
import SessionUtilitiesKit
public extension Network {
enum Destination: CustomStringConvertible {
case snode(LibSession.Snode)
case server(
url: URL,
method: HTTPMethod,
headers: [HTTPHeader: String]?,
x25519PublicKey: String
)
public var description: String {
switch self {
case .snode(let snode): return "Service node \(snode.address)"
case .server(let url, _, _, _): return url.host.defaulting(to: "Unknown Host")
}
}
}
}