Skip to content

Commit

Permalink
fixing PR items
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Aug 12, 2024
1 parent 4f0e247 commit a527f58
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 80 deletions.
23 changes: 0 additions & 23 deletions Packages/SublimationNgrok/Sources/SublimationKVdb/KVdb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,4 @@ public enum KVdb {
) -> URLType {
URLType(kvDBBase: baseString, keyBucketPath: path(forKey: key, atBucket: bucketName))
}

// /// Retrieves the URL for a given key in a bucket.
// ///
// /// - Parameters:
// /// - key: The key for the value.
// /// - bucketName: The name of the bucket.
// /// - session: The URLSession to use for the request. Defaults to `.ephemeral`.
// ///
// /// - Returns: The URL for the key, or `nil` if it doesn't exist.
// ///
// /// - Throws: An error if the request fails.
// @available(*, deprecated)
// public static func url<Key: Sendable>(
// withKey key: Key,
// atBucket bucketName: String,
// using session: URLSession = .ephemeral()
// ) async throws -> URL? {
// let repository = KVdbTunnelRepository<Key>(
// client: URLSessionClient<Key>(session: session),
// bucketName: bucketName
// )
// return try await repository.tunnel(forKey: key)
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public import Foundation
/// - invalidURL: The URL is invalid.
/// - cantSaveTunnel: Unable to save the tunnel with the given ID and data.
public enum KVdbServerError: Error {
// case clientNotSetup
// case noTunnelFound
case invalidURL
case cantSaveTunnel(Int?, Data?)
case cantSaveTunnelError(any Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public struct NgrokCLIAPIServer: TunnelServer, Sendable {
}
return nil
}


internal func newTunnel(
isConnectionRefused: @Sendable @escaping (ClientError) -> Bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,60 +162,6 @@ public actor TunnelSublimatory<
public nonisolated func server(_: any TunnelServer, errorDidOccur error: any Error) {
Task { await self.onError(error) }
}

/// Begins the Sublimation application from the given application.
///
/// - Parameters:
/// - application: The Vapor application.
///
/// - Note: This method is private and asynchronous.
///
/// - SeeAlso: `Application`
// private func beginFromApplication(_ application: @Sendable @escaping () -> any Application) async {
// let server = factory.server(
// from: TunnelServerFactoryType.Configuration(application: application()),
// handler: self
// )
// logger = application().logger
// tunnelRepo = repoFactory.setupClient(
// repoClientFactory(application)
// )
// self.server = server
// server.start(isConnectionRefused: isConnectionRefused)
// }

/// Called when the application is about to boot.
///
/// - Parameters:
/// - application: The Vapor application.
///
/// - Throws: An error if the application fails to begin.
///
/// - Note: This method is nonisolated.
///
/// - SeeAlso: `Application`
// public func willBoot(from application: @escaping @Sendable () -> any Application) async {
// await self.beginFromApplication(application)
// }
//
// func setupForApplication(_ application: @escaping @Sendable () -> any Application) {
// let server = factory.server(
// from: TunnelServerFactoryType.Configuration(application: application()),
// handler: self
// )
// logger = application().logger
// tunnelRepo = repoFactory.setupClient(
// repoClientFactory(application)
// )
// self.server = server
// }
//
// public nonisolated func initialize(for application: @escaping @Sendable () -> any Application) {
// Task {
// await self.setupForApplication(application)
// }
// }
//
func shutdownServer() { server.shutdown() }
public nonisolated func shutdown() { Task { await self.shutdownServer() } }
public func run() async throws {
Expand Down

0 comments on commit a527f58

Please sign in to comment.