Skip to content

Use explicit NIO imports #407

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

Merged
merged 5 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ let package = Package(
.library(name: "AsyncHTTPClient", targets: ["AsyncHTTPClient"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.30.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.14.0"),
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.18.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.14.1"),
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.18.2"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.10.0"),
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.11.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.0"),
Expand All @@ -33,29 +33,32 @@ let package = Package(
name: "AsyncHTTPClient",
dependencies: [
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "NIOHTTP2", package: "swift-nio-http2"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
.product(name: "NIOHTTPCompression", package: "swift-nio-extras"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "NIOSOCKS", package: "swift-nio-extras"),
.product(name: "NIOTransportServices", package: "swift-nio-transport-services"),
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOSOCKS", package: "swift-nio-extras"),
]
),
.testTarget(
name: "AsyncHTTPClientTests",
dependencies: [
.product(name: "NIO", package: "swift-nio"),
.target(name: "AsyncHTTPClient"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
.product(name: "NIOHTTP2", package: "swift-nio-http2"),
"AsyncHTTPClient",
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "NIOTestUtils", package: "swift-nio"),
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
.product(name: "NIOHTTP2", package: "swift-nio-http2"),
.product(name: "NIOSOCKS", package: "swift-nio-extras"),
.product(name: "Logging", package: "swift-log"),
]
),
]
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import Foundation
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOHTTP1
import NIOHTTPCompression
import NIOTLS
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/ConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import Foundation
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOHTTP1
import NIOSSL
import NIOTLS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1

final class HTTP1ProxyConnectHandler: ChannelDuplexHandler, RemovableChannelHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOSOCKS

final class SOCKSEventsHandler: ChannelInboundHandler, RemovableChannelHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOTLS

final class TLSEventsHandler: ChannelInboundHandler, RemovableChannelHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOCore
import NIOHTTP1

final class HTTP1ClientChannelHandler: ChannelDuplexHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOCore
import NIOHTTP1
import NIOHTTPCompression

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1

struct HTTP1ConnectionStateMachine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOCore
import NIOHTTP1
import NIOHTTP2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOCore
import NIOHTTP2

protocol HTTP2ConnectionDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOCore
import NIOHTTP2

protocol HTTP2IdleHandlerDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOCore
import NIOHTTP1
import NIOHTTPCompression
import NIOPosix
import NIOSOCKS
import NIOSSL
import NIOTLS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore

extension HTTPConnectionPool {
struct RequestID: Hashable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore

enum HTTPConnectionPool {
struct Connection: Hashable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOCore
import NIOHTTP1

/// # Protocol Overview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore

extension HTTPRequestStateMachine {
/// A sub state for receiving a response events. Stores whether the consumer has either signaled demand and whether the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1

struct HTTPRequestStateMachine {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/ConnectionsState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore

extension HTTP1ConnectionProvider {
enum Action<ConnectionType: PoolManageableConnection> {
Expand Down
3 changes: 2 additions & 1 deletion Sources/AsyncHTTPClient/FileDownloadDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1
import NIOPosix

/// Handles a streaming download to a given file path, allowing headers and progress to be reported.
public final class FileDownloadDelegate: HTTPClientResponseDelegate {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/HTTPClient+Proxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1

extension HTTPClient.Configuration {
Expand Down
3 changes: 2 additions & 1 deletion Sources/AsyncHTTPClient/HTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

import Foundation
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOHTTP1
import NIOHTTPCompression
import NIOPosix
import NIOSOCKS
import NIOSSL
import NIOTLS
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/HTTPHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import Foundation
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOFoundationCompat
import NIOHTTP1
import NIOHTTPCompression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#if canImport(Network)
import Network
#endif
import NIO
import NIOCore
import NIOHTTP1
import NIOTransportServices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import Foundation
import Network
import NIO
import NIOCore
import NIOSSL
import NIOTransportServices

Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/RequestBag+StateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import struct Foundation.URL
import NIO
import NIOCore
import NIOHTTP1

extension RequestBag {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/RequestBag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import struct Foundation.URL
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOHTTP1

final class RequestBag<Delegate: HTTPClientResponseDelegate> {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/RequestValidation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1

extension HTTPHeaders {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/ResponseReadBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1

struct ResponseReadBuffer {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/SSLContextCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import Dispatch
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOSSL

class SSLContextCache {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Foundation
import Network
#endif
import Logging
import NIO
import NIOCore
import NIOHTTP1
import NIOHTTPCompression
import NIOSSL
Expand Down
3 changes: 2 additions & 1 deletion Tests/AsyncHTTPClientTests/ConnectionPoolTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
//===----------------------------------------------------------------------===//

@testable import AsyncHTTPClient
@testable import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOEmbedded
import NIOFoundationCompat
import NIOHTTP1
import NIOHTTPCompression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

@testable import AsyncHTTPClient
import NIO
import NIOCore
import XCTest

class ConnectionForTests: PoolManageableConnection {
Expand Down
3 changes: 2 additions & 1 deletion Tests/AsyncHTTPClientTests/ConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//

@testable import AsyncHTTPClient
import NIO
import NIOCore
import NIOEmbedded
import XCTest

class ConnectionTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

@testable import AsyncHTTPClient
import Logging
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
import NIOHTTP2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

@testable import AsyncHTTPClient
import Logging
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

@testable import AsyncHTTPClient
import NIO
import NIOCore
import NIOHTTP1
import XCTest

Expand Down
Loading