diff --git a/Examples/Google/NaturalLanguage/Sources/language_service.grpc.swift b/Examples/Google/NaturalLanguage/Sources/language_service.grpc.swift index 75eb20105..b3db33239 100644 --- a/Examples/Google/NaturalLanguage/Sources/language_service.grpc.swift +++ b/Examples/Google/NaturalLanguage/Sources/language_service.grpc.swift @@ -6,8 +6,8 @@ // Source: google/cloud/language/v1/language_service.proto // import GRPC -import NIO -import NIOConcurrencyHelpers +@_implementationOnly import NIO +@_implementationOnly import NIOConcurrencyHelpers import SwiftProtobuf diff --git a/Examples/Google/NaturalLanguage/Sources/main.swift b/Examples/Google/NaturalLanguage/Sources/main.swift index a98529d17..aed35abff 100644 --- a/Examples/Google/NaturalLanguage/Sources/main.swift +++ b/Examples/Google/NaturalLanguage/Sources/main.swift @@ -16,10 +16,10 @@ import Dispatch import Foundation import GRPC -import NIO -import NIOHPACK -import NIOHTTP1 -import NIOSSL +@_implementationOnly import NIO +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOSSL import OAuth2 /// Create a client and return a future to provide its value. diff --git a/FuzzTesting/Sources/ServerFuzzerLib/ServerFuzzer.swift b/FuzzTesting/Sources/ServerFuzzerLib/ServerFuzzer.swift index 0cbbaafa3..bd73f5520 100644 --- a/FuzzTesting/Sources/ServerFuzzerLib/ServerFuzzer.swift +++ b/FuzzTesting/Sources/ServerFuzzerLib/ServerFuzzer.swift @@ -15,7 +15,7 @@ */ import EchoImplementation import GRPC -import NIO +@_implementationOnly import NIO @_cdecl("ServerFuzzer") public func test(_ start: UnsafeRawPointer, _ count: Int) -> CInt { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncBenchmarkServiceImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncBenchmarkServiceImpl.swift index 6a41206b1..c88882f94 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncBenchmarkServiceImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncBenchmarkServiceImpl.swift @@ -16,7 +16,7 @@ import Foundation import GRPC -import NIOCore +@_implementationOnly import NIOCore /// Implementation of asynchronous service for benchmarking. final class AsyncBenchmarkServiceImpl: Grpc_Testing_BenchmarkServiceAsyncProvider { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncClientProtocol.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncClientProtocol.swift index 3414e519a..c3db73f64 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncClientProtocol.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncClientProtocol.swift @@ -15,7 +15,7 @@ */ import GRPC -import NIOCore +@_implementationOnly import NIOCore /// Protocol which async clients must implement. protocol AsyncQPSClient { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncPingPongRequestMaker.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncPingPongRequestMaker.swift index ae497d80c..27e835643 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncPingPongRequestMaker.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncPingPongRequestMaker.swift @@ -18,7 +18,7 @@ import Atomics import Foundation import GRPC import Logging -import NIOCore +@_implementationOnly import NIOCore /// Makes streaming requests and listens to responses ping-pong style. /// Iterations can be limited by config. diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSClientImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSClientImpl.swift index b764cc770..6261473ef 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSClientImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSClientImpl.swift @@ -19,9 +19,9 @@ import BenchmarkUtils import Foundation import GRPC import Logging -import NIOConcurrencyHelpers -import NIOCore -import NIOPosix +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix /// Client to make a series of asynchronous calls. final class AsyncQPSClientImpl: AsyncQPSClient { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSServerImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSServerImpl.swift index a5112aa8b..b3d5b45de 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSServerImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncQPSServerImpl.swift @@ -17,8 +17,8 @@ import Foundation import GRPC import Logging -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix /// Server setup for asynchronous requests. final class AsyncQPSServerImpl: AsyncQPSServer { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncServerProtocol.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncServerProtocol.swift index 60e1c33b0..5bf38d1fb 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncServerProtocol.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncServerProtocol.swift @@ -15,7 +15,7 @@ */ import GRPC -import NIOCore +@_implementationOnly import NIOCore /// Interface server types must implement when using async APIs. protocol AsyncQPSServer { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncUnaryRequestMaker.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncUnaryRequestMaker.swift index 5921ef038..11d8e01db 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncUnaryRequestMaker.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncUnaryRequestMaker.swift @@ -16,7 +16,7 @@ import GRPC import Logging -import NIOCore +@_implementationOnly import NIOCore /// Makes unary requests to the server and records performance statistics. final class AsyncUnaryRequestMaker: AsyncRequestMaker { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncWorkerServiceImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncWorkerServiceImpl.swift index 2b82d9d60..c93f269b3 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncWorkerServiceImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Async/AsyncWorkerServiceImpl.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import GRPC -import NIOCore +@_implementationOnly import NIOCore // Implementation of the control service for communication with the driver process. actor AsyncWorkerServiceImpl: Grpc_Testing_WorkerServiceAsyncProvider { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/ClientUtilities.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/ClientUtilities.swift index 18a3d2db2..8a2da845f 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/ClientUtilities.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/ClientUtilities.swift @@ -15,7 +15,7 @@ */ import GRPC -import NIOCore +@_implementationOnly import NIOCore extension Grpc_Testing_ClientConfig { /// Work out how many theads to use - defaulting to core count if not specified. diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOBenchmarkServiceImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOBenchmarkServiceImpl.swift index 1ed385b86..1cf881bf0 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOBenchmarkServiceImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOBenchmarkServiceImpl.swift @@ -16,7 +16,7 @@ import Foundation import GRPC -import NIOCore +@_implementationOnly import NIOCore /// Implementation of asynchronous service for benchmarking. final class NIOBenchmarkServiceImpl: Grpc_Testing_BenchmarkServiceProvider { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOClientProtocol.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOClientProtocol.swift index dea3f1fdb..9092bcb40 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOClientProtocol.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOClientProtocol.swift @@ -15,7 +15,7 @@ */ import GRPC -import NIOCore +@_implementationOnly import NIOCore /// Protocol which clients must implement. protocol NIOQPSClient { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOPingPongRequestMaker.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOPingPongRequestMaker.swift index 9a40c010c..980988991 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOPingPongRequestMaker.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOPingPongRequestMaker.swift @@ -17,7 +17,7 @@ import Foundation import GRPC import Logging -import NIOCore +@_implementationOnly import NIOCore /// Makes streaming requests and listens to responses ping-pong style. /// Iterations can be limited by config. diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSClientImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSClientImpl.swift index 3e7a5f2f8..17d66202f 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSClientImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSClientImpl.swift @@ -19,9 +19,9 @@ import BenchmarkUtils import Foundation import GRPC import Logging -import NIOConcurrencyHelpers -import NIOCore -import NIOPosix +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix /// Client to make a series of asynchronous calls. final class NIOQPSClientImpl: NIOQPSClient { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSServerImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSServerImpl.swift index 234833ed7..37a6397dd 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSServerImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOQPSServerImpl.swift @@ -17,8 +17,8 @@ import Foundation import GRPC import Logging -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix /// Server setup for asynchronous requests (using EventLoopFutures). final class NIOQPSServerImpl: NIOQPSServer { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIORequestMaker.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIORequestMaker.swift index 3bbb74b87..c3107ee15 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIORequestMaker.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIORequestMaker.swift @@ -16,7 +16,7 @@ import GRPC import Logging -import NIOCore +@_implementationOnly import NIOCore /// Implement to provide a method of making requests to a server from a client. protocol NIORequestMaker { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOServerProtocol.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOServerProtocol.swift index 7a04207e6..804915075 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOServerProtocol.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOServerProtocol.swift @@ -15,7 +15,7 @@ */ import GRPC -import NIOCore +@_implementationOnly import NIOCore /// Interface server types must implement when using NIO. protocol NIOQPSServer { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOUnaryRequestMaker.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOUnaryRequestMaker.swift index ba2feb807..3e3648cfa 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOUnaryRequestMaker.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOUnaryRequestMaker.swift @@ -16,7 +16,7 @@ import GRPC import Logging -import NIOCore +@_implementationOnly import NIOCore /// Makes unary requests to the server and records performance statistics. final class NIOUnaryRequestMaker: NIORequestMaker { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOWorkerServiceImpl.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOWorkerServiceImpl.swift index 1466d5e17..767d3e6da 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOWorkerServiceImpl.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/NIO/NIOWorkerServiceImpl.swift @@ -15,7 +15,7 @@ */ import GRPC -import NIOCore +@_implementationOnly import NIOCore // Implementation of the control service for communication with the driver process. class NIOWorkerServiceImpl: Grpc_Testing_WorkerServiceProvider { diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/QPSWorker.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/QPSWorker.swift index 1dd44e86b..199149d14 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/QPSWorker.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/QPSWorker.swift @@ -16,8 +16,8 @@ import GRPC import Logging -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix /// Sets up and runs a worker service which listens for instructions on what tests to run. /// Currently doesn't understand TLS for communication with the driver. diff --git a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Stats.swift b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Stats.swift index 5e33f3924..e82e48c3c 100644 --- a/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Stats.swift +++ b/Performance/QPSBenchmark/Sources/QPSBenchmark/Runtime/Stats.swift @@ -15,7 +15,7 @@ */ import BenchmarkUtils -import NIOConcurrencyHelpers +@_implementationOnly import NIOConcurrencyHelpers /// Convenience holder for collected statistics. struct Stats { diff --git a/Sources/Examples/Echo/Implementation/EchoProvider.swift b/Sources/Examples/Echo/Implementation/EchoProvider.swift index b0834994f..487ebfcf8 100644 --- a/Sources/Examples/Echo/Implementation/EchoProvider.swift +++ b/Sources/Examples/Echo/Implementation/EchoProvider.swift @@ -15,7 +15,7 @@ */ import EchoModel import GRPC -import NIOCore +@_implementationOnly import NIOCore import SwiftProtobuf public class EchoProvider: Echo_EchoProvider { diff --git a/Sources/Examples/Echo/Implementation/HPACKHeaders+Prettify.swift b/Sources/Examples/Echo/Implementation/HPACKHeaders+Prettify.swift index bf4e9c63b..0bef5b5bd 100644 --- a/Sources/Examples/Echo/Implementation/HPACKHeaders+Prettify.swift +++ b/Sources/Examples/Echo/Implementation/HPACKHeaders+Prettify.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK func prettify(_ headers: HPACKHeaders) -> String { return "[" + headers.map { name, value, _ in diff --git a/Sources/Examples/Echo/Implementation/Interceptors.swift b/Sources/Examples/Echo/Implementation/Interceptors.swift index 28abb0a37..71b0b00ee 100644 --- a/Sources/Examples/Echo/Implementation/Interceptors.swift +++ b/Sources/Examples/Echo/Implementation/Interceptors.swift @@ -15,7 +15,7 @@ */ import EchoModel import GRPC -import NIOCore +@_implementationOnly import NIOCore // All client interceptors derive from the 'ClientInterceptor' base class. We know the request and // response types for all Echo RPCs are the same: so we'll use them concretely here, allowing us diff --git a/Sources/Examples/Echo/Model/echo.grpc.swift b/Sources/Examples/Echo/Model/echo.grpc.swift index 6763b31cc..387ea7f60 100644 --- a/Sources/Examples/Echo/Model/echo.grpc.swift +++ b/Sources/Examples/Echo/Model/echo.grpc.swift @@ -6,8 +6,8 @@ // Source: echo.proto // import GRPC -import NIO -import NIOConcurrencyHelpers +@_implementationOnly import NIO +@_implementationOnly import NIOConcurrencyHelpers import SwiftProtobuf diff --git a/Sources/Examples/Echo/Runtime/Echo.swift b/Sources/Examples/Echo/Runtime/Echo.swift index 65abd883d..a9f8021cc 100644 --- a/Sources/Examples/Echo/Runtime/Echo.swift +++ b/Sources/Examples/Echo/Runtime/Echo.swift @@ -18,10 +18,10 @@ import EchoImplementation import EchoModel import GRPC import GRPCSampleData -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif // MARK: - Argument parsing diff --git a/Sources/Examples/HelloWorld/Client/HelloWorldClient.swift b/Sources/Examples/HelloWorld/Client/HelloWorldClient.swift index 253e7c19c..7a367594a 100644 --- a/Sources/Examples/HelloWorld/Client/HelloWorldClient.swift +++ b/Sources/Examples/HelloWorld/Client/HelloWorldClient.swift @@ -16,8 +16,8 @@ import ArgumentParser import GRPC import HelloWorldModel -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) @main diff --git a/Sources/Examples/HelloWorld/Model/helloworld.grpc.swift b/Sources/Examples/HelloWorld/Model/helloworld.grpc.swift index 014226e95..a351a0f68 100644 --- a/Sources/Examples/HelloWorld/Model/helloworld.grpc.swift +++ b/Sources/Examples/HelloWorld/Model/helloworld.grpc.swift @@ -6,8 +6,8 @@ // Source: helloworld.proto // import GRPC -import NIO -import NIOConcurrencyHelpers +@_implementationOnly import NIO +@_implementationOnly import NIOConcurrencyHelpers import SwiftProtobuf diff --git a/Sources/Examples/HelloWorld/Server/GreeterProvider.swift b/Sources/Examples/HelloWorld/Server/GreeterProvider.swift index bf6ea4449..a9514e2c8 100644 --- a/Sources/Examples/HelloWorld/Server/GreeterProvider.swift +++ b/Sources/Examples/HelloWorld/Server/GreeterProvider.swift @@ -15,7 +15,7 @@ */ import GRPC import HelloWorldModel -import NIOCore +@_implementationOnly import NIOCore @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) final class GreeterProvider: Helloworld_GreeterAsyncProvider { diff --git a/Sources/Examples/HelloWorld/Server/HelloWorldServer.swift b/Sources/Examples/HelloWorld/Server/HelloWorldServer.swift index 038728a9f..ec8aec1db 100644 --- a/Sources/Examples/HelloWorld/Server/HelloWorldServer.swift +++ b/Sources/Examples/HelloWorld/Server/HelloWorldServer.swift @@ -16,8 +16,8 @@ import ArgumentParser import GRPC import HelloWorldModel -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) @main diff --git a/Sources/Examples/PacketCapture/PacketCapture.swift b/Sources/Examples/PacketCapture/PacketCapture.swift index 8d1544b47..899d9e40c 100644 --- a/Sources/Examples/PacketCapture/PacketCapture.swift +++ b/Sources/Examples/PacketCapture/PacketCapture.swift @@ -16,9 +16,9 @@ import ArgumentParser import EchoModel import GRPC -import NIOCore -import NIOExtras -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOExtras +@_implementationOnly import NIOPosix @main @available(macOS 10.15, *) diff --git a/Sources/Examples/RouteGuide/Client/RouteGuideClient.swift b/Sources/Examples/RouteGuide/Client/RouteGuideClient.swift index 47710deef..b1c95c455 100644 --- a/Sources/Examples/RouteGuide/Client/RouteGuideClient.swift +++ b/Sources/Examples/RouteGuide/Client/RouteGuideClient.swift @@ -16,8 +16,8 @@ import ArgumentParser import Foundation import GRPC -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix import RouteGuideModel /// Loads the features from `route_guide_db.json`, assumed to be in the directory above this file. diff --git a/Sources/Examples/RouteGuide/Model/route_guide.grpc.swift b/Sources/Examples/RouteGuide/Model/route_guide.grpc.swift index 71b372d35..9b3e4188b 100644 --- a/Sources/Examples/RouteGuide/Model/route_guide.grpc.swift +++ b/Sources/Examples/RouteGuide/Model/route_guide.grpc.swift @@ -6,8 +6,8 @@ // Source: route_guide.proto // import GRPC -import NIO -import NIOConcurrencyHelpers +@_implementationOnly import NIO +@_implementationOnly import NIOConcurrencyHelpers import SwiftProtobuf diff --git a/Sources/Examples/RouteGuide/Server/RouteGuideProvider.swift b/Sources/Examples/RouteGuide/Server/RouteGuideProvider.swift index 63fa450b5..6e094ecab 100644 --- a/Sources/Examples/RouteGuide/Server/RouteGuideProvider.swift +++ b/Sources/Examples/RouteGuide/Server/RouteGuideProvider.swift @@ -15,8 +15,8 @@ */ import Foundation import GRPC -import NIOConcurrencyHelpers -import NIOCore +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore import RouteGuideModel @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/Examples/RouteGuide/Server/RouteGuideServer.swift b/Sources/Examples/RouteGuide/Server/RouteGuideServer.swift index 02af3b2b6..ba80f12ef 100644 --- a/Sources/Examples/RouteGuide/Server/RouteGuideServer.swift +++ b/Sources/Examples/RouteGuide/Server/RouteGuideServer.swift @@ -17,8 +17,8 @@ import ArgumentParser import struct Foundation.Data import struct Foundation.URL import GRPC -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix import RouteGuideModel /// Loads the features from `route_guide_db.json`, assumed to be in the directory above this file. diff --git a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Actions.swift b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Actions.swift index c1aae5c00..484e737bd 100644 --- a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Actions.swift +++ b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Actions.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension ServerHandlerStateMachine { diff --git a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Draining.swift b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Draining.swift index ffe572ef2..f79191ba8 100644 --- a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Draining.swift +++ b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Draining.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension ServerHandlerStateMachine { diff --git a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Finished.swift b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Finished.swift index 8c978cbf3..b85311182 100644 --- a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Finished.swift +++ b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Finished.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension ServerHandlerStateMachine { diff --git a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Handling.swift b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Handling.swift index 424f5afb8..ce185325c 100644 --- a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Handling.swift +++ b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Handling.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension ServerHandlerStateMachine { diff --git a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Idle.swift b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Idle.swift index a017bddac..a3b4cc4d8 100644 --- a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Idle.swift +++ b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine+Idle.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension ServerHandlerStateMachine { diff --git a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine.swift b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine.swift index 23c3728de..cbf9ada9e 100644 --- a/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine.swift +++ b/Sources/GRPC/AsyncAwaitSupport/AsyncServerHandler/ServerHandlerStateMachine/ServerHandlerStateMachine.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) @usableFromInline diff --git a/Sources/GRPC/AsyncAwaitSupport/Call+AsyncRequestStreamWriter.swift b/Sources/GRPC/AsyncAwaitSupport/Call+AsyncRequestStreamWriter.swift index 720ced509..bf0bacbba 100644 --- a/Sources/GRPC/AsyncAwaitSupport/Call+AsyncRequestStreamWriter.swift +++ b/Sources/GRPC/AsyncAwaitSupport/Call+AsyncRequestStreamWriter.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension Call where Request: Sendable, Response: Sendable { diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncBidirectionalStreamingCall.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncBidirectionalStreamingCall.swift index 271da849e..aafb5304c 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncBidirectionalStreamingCall.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncBidirectionalStreamingCall.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK /// Async-await variant of ``BidirectionalStreamingCall``. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncClientStreamingCall.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncClientStreamingCall.swift index 3d96f2a35..370f90e8b 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncClientStreamingCall.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncClientStreamingCall.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK /// Async-await variant of ``ClientStreamingCall``. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStream.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStream.swift index 500a859bf..f8c2d139c 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStream.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStream.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// A type for the stream of request messages send to a gRPC server method. /// diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStreamWriter.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStreamWriter.swift index 9516d00a6..78101c331 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStreamWriter.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStreamWriter.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// An object allowing the holder -- a client -- to send requests on an RPC. /// diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStream.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStream.swift index 225fa31d8..c9dba028b 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStream.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStream.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// This is currently a wrapper around AsyncThrowingStream because we want to be /// able to swap out the implementation for something else in the future. diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStreamWriter.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStreamWriter.swift index c00490c8a..4ce13f746 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStreamWriter.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncResponseStreamWriter.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// Writer for server-streaming RPC handlers to provide responses. /// diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncSequenceProducerDelegate.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncSequenceProducerDelegate.swift index baca7ba91..16a7b29c9 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncSequenceProducerDelegate.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncSequenceProducerDelegate.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore @usableFromInline internal struct GRPCAsyncSequenceProducerDelegate: NIOAsyncSequenceProducerDelegate { diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerCallContext.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerCallContext.swift index d12515962..4343b92c6 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerCallContext.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerCallContext.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import Logging -import NIOConcurrencyHelpers -import NIOHPACK +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public struct GRPCAsyncServerCallContext: Sendable { diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerHandler.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerHandler.swift index 6da95584b..d8f1c2778 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerHandler.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerHandler.swift @@ -15,8 +15,8 @@ */ import DequeModule import Logging -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public struct GRPCAsyncServerHandler< diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerStreamingCall.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerStreamingCall.swift index 26b7506e7..9c2144bf7 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerStreamingCall.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerStreamingCall.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK /// Async-await variant of ``ServerStreamingCall``. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncUnaryCall.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncUnaryCall.swift index 6a9748f84..787fa0b90 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncUnaryCall.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncUnaryCall.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK /// A unary gRPC call. The request is sent on initialization. /// diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncWriterSinkDelegate.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncWriterSinkDelegate.swift index 9e9b088a2..ed9c5f7d9 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncWriterSinkDelegate.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCAsyncWriterSinkDelegate.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import DequeModule -import NIOCore +@_implementationOnly import NIOCore @usableFromInline internal struct GRPCAsyncWriterSinkDelegate: NIOAsyncWriterSinkDelegate { diff --git a/Sources/GRPC/AsyncAwaitSupport/GRPCSendable.swift b/Sources/GRPC/AsyncAwaitSupport/GRPCSendable.swift index a94525a48..1e8bd086d 100644 --- a/Sources/GRPC/AsyncAwaitSupport/GRPCSendable.swift +++ b/Sources/GRPC/AsyncAwaitSupport/GRPCSendable.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore @available(*, deprecated, renamed: "Swift.Sendable") public typealias GRPCSendable = Swift.Sendable diff --git a/Sources/GRPC/AsyncAwaitSupport/NIOAsyncWrappers.swift b/Sources/GRPC/AsyncAwaitSupport/NIOAsyncWrappers.swift index 9269d9b2f..6b7bc81bd 100644 --- a/Sources/GRPC/AsyncAwaitSupport/NIOAsyncWrappers.swift +++ b/Sources/GRPC/AsyncAwaitSupport/NIOAsyncWrappers.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// Unchecked-sendable wrapper for ``NIOAsyncWriter/Sink``, to avoid getting sendability warnings. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/GRPC/CallHandlers/BidirectionalStreamingServerHandler.swift b/Sources/GRPC/CallHandlers/BidirectionalStreamingServerHandler.swift index 229cb1b5e..b378e88b3 100644 --- a/Sources/GRPC/CallHandlers/BidirectionalStreamingServerHandler.swift +++ b/Sources/GRPC/CallHandlers/BidirectionalStreamingServerHandler.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK public final class BidirectionalStreamingServerHandler< Serializer: MessageSerializer, diff --git a/Sources/GRPC/CallHandlers/ClientStreamingServerHandler.swift b/Sources/GRPC/CallHandlers/ClientStreamingServerHandler.swift index 2e1167998..19fed24bb 100644 --- a/Sources/GRPC/CallHandlers/ClientStreamingServerHandler.swift +++ b/Sources/GRPC/CallHandlers/ClientStreamingServerHandler.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK public final class ClientStreamingServerHandler< Serializer: MessageSerializer, diff --git a/Sources/GRPC/CallHandlers/ServerHandlerProtocol.swift b/Sources/GRPC/CallHandlers/ServerHandlerProtocol.swift index 8c3f68796..699b8664a 100644 --- a/Sources/GRPC/CallHandlers/ServerHandlerProtocol.swift +++ b/Sources/GRPC/CallHandlers/ServerHandlerProtocol.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK /// This protocol lays out the inbound interface between the gRPC module and generated server code. /// On receiving a new RPC, gRPC will ask all available service providers for an instance of this diff --git a/Sources/GRPC/CallHandlers/ServerStreamingServerHandler.swift b/Sources/GRPC/CallHandlers/ServerStreamingServerHandler.swift index 7028020c6..d7aa5c983 100644 --- a/Sources/GRPC/CallHandlers/ServerStreamingServerHandler.swift +++ b/Sources/GRPC/CallHandlers/ServerStreamingServerHandler.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK public final class ServerStreamingServerHandler< Serializer: MessageSerializer, diff --git a/Sources/GRPC/CallHandlers/UnaryServerHandler.swift b/Sources/GRPC/CallHandlers/UnaryServerHandler.swift index c0a84abb6..cede9f6c8 100644 --- a/Sources/GRPC/CallHandlers/UnaryServerHandler.swift +++ b/Sources/GRPC/CallHandlers/UnaryServerHandler.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK public final class UnaryServerHandler< Serializer: MessageSerializer, diff --git a/Sources/GRPC/CallOptions.swift b/Sources/GRPC/CallOptions.swift index 00bffb3cd..16368679c 100644 --- a/Sources/GRPC/CallOptions.swift +++ b/Sources/GRPC/CallOptions.swift @@ -15,12 +15,12 @@ */ import struct Foundation.UUID -import NIOCore +@_implementationOnly import NIOCore import Logging -import NIOHPACK -import NIOHTTP1 -import NIOHTTP2 +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 /// Options to use for GRPC calls. public struct CallOptions: Sendable { diff --git a/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift b/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift index dff23a5c2..02d16f32e 100644 --- a/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift +++ b/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 /// A bidirectional-streaming gRPC call. Each response is passed to the provided observer block. /// diff --git a/Sources/GRPC/ClientCalls/Call.swift b/Sources/GRPC/ClientCalls/Call.swift index 759798836..5a89bead2 100644 --- a/Sources/GRPC/ClientCalls/Call.swift +++ b/Sources/GRPC/ClientCalls/Call.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 import protocol SwiftProtobuf.Message /// An object representing a single RPC from the perspective of a client. It allows the caller to diff --git a/Sources/GRPC/ClientCalls/ClientCall.swift b/Sources/GRPC/ClientCalls/ClientCall.swift index d2d386893..d67f24fa1 100644 --- a/Sources/GRPC/ClientCalls/ClientCall.swift +++ b/Sources/GRPC/ClientCalls/ClientCall.swift @@ -14,10 +14,10 @@ * limitations under the License. */ import Foundation -import NIOCore -import NIOHPACK -import NIOHTTP1 -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 import SwiftProtobuf /// Base protocol for a client call to a gRPC service. diff --git a/Sources/GRPC/ClientCalls/ClientStreamingCall.swift b/Sources/GRPC/ClientCalls/ClientStreamingCall.swift index 7f8bcd581..83a6cbece 100644 --- a/Sources/GRPC/ClientCalls/ClientStreamingCall.swift +++ b/Sources/GRPC/ClientCalls/ClientStreamingCall.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 /// A client-streaming gRPC call. /// diff --git a/Sources/GRPC/ClientCalls/LazyEventLoopPromise.swift b/Sources/GRPC/ClientCalls/LazyEventLoopPromise.swift index 6abbac63a..e20c2431d 100644 --- a/Sources/GRPC/ClientCalls/LazyEventLoopPromise.swift +++ b/Sources/GRPC/ClientCalls/LazyEventLoopPromise.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOConcurrencyHelpers -import NIOCore +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore extension EventLoop { internal func makeLazyPromise(of: Value.Type = Value.self) -> LazyEventLoopPromise { diff --git a/Sources/GRPC/ClientCalls/ResponseContainers.swift b/Sources/GRPC/ClientCalls/ResponseContainers.swift index d8bf6411c..15e76d3d7 100644 --- a/Sources/GRPC/ClientCalls/ResponseContainers.swift +++ b/Sources/GRPC/ClientCalls/ResponseContainers.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK /// A bucket of promises for a unary-response RPC. internal class UnaryResponseParts { diff --git a/Sources/GRPC/ClientCalls/ResponsePartContainer.swift b/Sources/GRPC/ClientCalls/ResponsePartContainer.swift index 9014a601e..efdd960ac 100644 --- a/Sources/GRPC/ClientCalls/ResponsePartContainer.swift +++ b/Sources/GRPC/ClientCalls/ResponsePartContainer.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK /// A container for RPC response parts. internal struct ResponsePartContainer { diff --git a/Sources/GRPC/ClientCalls/ServerStreamingCall.swift b/Sources/GRPC/ClientCalls/ServerStreamingCall.swift index 67b93226e..076da4842 100644 --- a/Sources/GRPC/ClientCalls/ServerStreamingCall.swift +++ b/Sources/GRPC/ClientCalls/ServerStreamingCall.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 /// A server-streaming gRPC call. The request is sent on initialization, each response is passed to /// the provided observer block. diff --git a/Sources/GRPC/ClientCalls/UnaryCall.swift b/Sources/GRPC/ClientCalls/UnaryCall.swift index 5efd9f819..8c8d002f4 100644 --- a/Sources/GRPC/ClientCalls/UnaryCall.swift +++ b/Sources/GRPC/ClientCalls/UnaryCall.swift @@ -15,10 +15,10 @@ */ import Foundation import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 import SwiftProtobuf /// A unary gRPC call. The request is sent on initialization. diff --git a/Sources/GRPC/ClientConnection.swift b/Sources/GRPC/ClientConnection.swift index e3ac756e0..d6c03fccc 100644 --- a/Sources/GRPC/ClientConnection.swift +++ b/Sources/GRPC/ClientConnection.swift @@ -20,14 +20,14 @@ import Foundation #endif import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif -import NIOTLS -import NIOTransportServices +@_implementationOnly import NIOTLS +@_implementationOnly import NIOTransportServices import SwiftProtobuf /// Provides a single, managed connection to a server which is guaranteed to always use the same diff --git a/Sources/GRPC/ClientConnectionConfiguration+NIOSSL.swift b/Sources/GRPC/ClientConnectionConfiguration+NIOSSL.swift index 6de8b4e83..171e47b1e 100644 --- a/Sources/GRPC/ClientConnectionConfiguration+NIOSSL.swift +++ b/Sources/GRPC/ClientConnectionConfiguration+NIOSSL.swift @@ -14,7 +14,7 @@ * limitations under the License. */ #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL extension ClientConnection.Configuration { /// TLS configuration for a `ClientConnection`. diff --git a/Sources/GRPC/CoalescingLengthPrefixedMessageWriter.swift b/Sources/GRPC/CoalescingLengthPrefixedMessageWriter.swift index f36bb5ad8..9d7499a72 100644 --- a/Sources/GRPC/CoalescingLengthPrefixedMessageWriter.swift +++ b/Sources/GRPC/CoalescingLengthPrefixedMessageWriter.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import DequeModule -import NIOCore +@_implementationOnly import NIOCore internal struct CoalescingLengthPrefixedMessageWriter { /// Length of the gRPC message header (1 compression byte, 4 bytes for the length). diff --git a/Sources/GRPC/Compression/Zlib.swift b/Sources/GRPC/Compression/Zlib.swift index d5d1dc8c9..b1adde1c8 100644 --- a/Sources/GRPC/Compression/Zlib.swift +++ b/Sources/GRPC/Compression/Zlib.swift @@ -15,7 +15,7 @@ */ import CGRPCZlib import struct Foundation.Data -import NIOCore +@_implementationOnly import NIOCore /// Provides minimally configurable wrappers around zlib's compression and decompression /// functionality. diff --git a/Sources/GRPC/ConnectionKeepalive.swift b/Sources/GRPC/ConnectionKeepalive.swift index 841081f81..aaeb83010 100644 --- a/Sources/GRPC/ConnectionKeepalive.swift +++ b/Sources/GRPC/ConnectionKeepalive.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// Provides keepalive pings. /// diff --git a/Sources/GRPC/ConnectionManager.swift b/Sources/GRPC/ConnectionManager.swift index efb801e48..58422b2b8 100644 --- a/Sources/GRPC/ConnectionManager.swift +++ b/Sources/GRPC/ConnectionManager.swift @@ -15,9 +15,9 @@ */ import Foundation import Logging -import NIOConcurrencyHelpers -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 // Unchecked because mutable state is always accessed and modified on a particular event loop. // APIs which _may_ be called from different threads execute onto the correct event loop first. diff --git a/Sources/GRPC/ConnectionManagerChannelProvider.swift b/Sources/GRPC/ConnectionManagerChannelProvider.swift index aaa6cf560..f39d0454f 100644 --- a/Sources/GRPC/ConnectionManagerChannelProvider.swift +++ b/Sources/GRPC/ConnectionManagerChannelProvider.swift @@ -14,12 +14,12 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif -import NIOTransportServices +@_implementationOnly import NIOTransportServices @usableFromInline internal protocol ConnectionManagerChannelProvider { diff --git a/Sources/GRPC/ConnectionPool/ConnectionPool+PerConnectionState.swift b/Sources/GRPC/ConnectionPool/ConnectionPool+PerConnectionState.swift index 0d4211924..806035e27 100644 --- a/Sources/GRPC/ConnectionPool/ConnectionPool+PerConnectionState.swift +++ b/Sources/GRPC/ConnectionPool/ConnectionPool+PerConnectionState.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHTTP2 +@_implementationOnly import NIOHTTP2 extension ConnectionPool { @usableFromInline diff --git a/Sources/GRPC/ConnectionPool/ConnectionPool+Waiter.swift b/Sources/GRPC/ConnectionPool/ConnectionPool+Waiter.swift index ac9b6d810..44cc61713 100644 --- a/Sources/GRPC/ConnectionPool/ConnectionPool+Waiter.swift +++ b/Sources/GRPC/ConnectionPool/ConnectionPool+Waiter.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 extension ConnectionPool { @usableFromInline diff --git a/Sources/GRPC/ConnectionPool/ConnectionPool.swift b/Sources/GRPC/ConnectionPool/ConnectionPool.swift index 40c633764..b1fbe7a01 100644 --- a/Sources/GRPC/ConnectionPool/ConnectionPool.swift +++ b/Sources/GRPC/ConnectionPool/ConnectionPool.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOConcurrencyHelpers -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 @usableFromInline internal final class ConnectionPool { diff --git a/Sources/GRPC/ConnectionPool/GRPCChannelPool.swift b/Sources/GRPC/ConnectionPool/GRPCChannelPool.swift index 6011d071d..f8dea4157 100644 --- a/Sources/GRPC/ConnectionPool/GRPCChannelPool.swift +++ b/Sources/GRPC/ConnectionPool/GRPCChannelPool.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix public enum GRPCChannelPool { /// Make a new ``GRPCChannel`` on which calls may be made to gRPC services. diff --git a/Sources/GRPC/ConnectionPool/PoolManager.swift b/Sources/GRPC/ConnectionPool/PoolManager.swift index a6e53d59f..9bbaaf3e3 100644 --- a/Sources/GRPC/ConnectionPool/PoolManager.swift +++ b/Sources/GRPC/ConnectionPool/PoolManager.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import Logging -import NIOConcurrencyHelpers -import NIOCore +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore // Unchecked because all mutable state is protected by a lock. extension PooledChannel: @unchecked Sendable {} diff --git a/Sources/GRPC/ConnectionPool/PoolManagerStateMachine+PerPoolState.swift b/Sources/GRPC/ConnectionPool/PoolManagerStateMachine+PerPoolState.swift index 011038ad4..7bf9f58ee 100644 --- a/Sources/GRPC/ConnectionPool/PoolManagerStateMachine+PerPoolState.swift +++ b/Sources/GRPC/ConnectionPool/PoolManagerStateMachine+PerPoolState.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore extension PoolManagerStateMachine.ActiveState { @usableFromInline diff --git a/Sources/GRPC/ConnectionPool/PoolManagerStateMachine.swift b/Sources/GRPC/ConnectionPool/PoolManagerStateMachine.swift index 62a2c7e56..db89226d5 100644 --- a/Sources/GRPC/ConnectionPool/PoolManagerStateMachine.swift +++ b/Sources/GRPC/ConnectionPool/PoolManagerStateMachine.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore @usableFromInline internal struct PoolManagerStateMachine { diff --git a/Sources/GRPC/ConnectionPool/PooledChannel.swift b/Sources/GRPC/ConnectionPool/PooledChannel.swift index f7e3af01a..ac71c772a 100644 --- a/Sources/GRPC/ConnectionPool/PooledChannel.swift +++ b/Sources/GRPC/ConnectionPool/PooledChannel.swift @@ -14,10 +14,10 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif import SwiftProtobuf diff --git a/Sources/GRPC/ConnectivityState.swift b/Sources/GRPC/ConnectivityState.swift index ff238ce65..7a1106967 100644 --- a/Sources/GRPC/ConnectivityState.swift +++ b/Sources/GRPC/ConnectivityState.swift @@ -15,8 +15,8 @@ */ import Foundation import Logging -import NIOConcurrencyHelpers -import NIOCore +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore /// The connectivity state of a client connection. Note that this is heavily lifted from the gRPC /// documentation: https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md. diff --git a/Sources/GRPC/DelegatingErrorHandler.swift b/Sources/GRPC/DelegatingErrorHandler.swift index b89562eb4..af7cb78f5 100644 --- a/Sources/GRPC/DelegatingErrorHandler.swift +++ b/Sources/GRPC/DelegatingErrorHandler.swift @@ -15,7 +15,7 @@ */ import Foundation import Logging -import NIOCore +@_implementationOnly import NIOCore /// A channel handler which allows caught errors to be passed to a `ClientErrorDelegate`. This /// handler is intended to be used in the client channel pipeline after the HTTP/2 stream diff --git a/Sources/GRPC/Error+NIOSSL.swift b/Sources/GRPC/Error+NIOSSL.swift index b796d6fcd..3d36d55a4 100644 --- a/Sources/GRPC/Error+NIOSSL.swift +++ b/Sources/GRPC/Error+NIOSSL.swift @@ -14,7 +14,7 @@ * limitations under the License. */ #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif extension Error { diff --git a/Sources/GRPC/EventLoopFuture+RecoverFromUncleanShutdown.swift b/Sources/GRPC/EventLoopFuture+RecoverFromUncleanShutdown.swift index 335988a97..216ecee57 100644 --- a/Sources/GRPC/EventLoopFuture+RecoverFromUncleanShutdown.swift +++ b/Sources/GRPC/EventLoopFuture+RecoverFromUncleanShutdown.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore extension EventLoopFuture where Value == Void { internal func recoveringFromUncleanShutdown() -> EventLoopFuture { diff --git a/Sources/GRPC/FakeChannel.swift b/Sources/GRPC/FakeChannel.swift index 8348b215f..880e2cbe1 100644 --- a/Sources/GRPC/FakeChannel.swift +++ b/Sources/GRPC/FakeChannel.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOEmbedded +@_implementationOnly import NIOCore +@_implementationOnly import NIOEmbedded import SwiftProtobuf // This type is deprecated, but we need to '@unchecked Sendable' to avoid warnings in our own code. diff --git a/Sources/GRPC/GRPCChannel/ClientConnection+NIOSSL.swift b/Sources/GRPC/GRPCChannel/ClientConnection+NIOSSL.swift index ca53cc1f6..f684d5e38 100644 --- a/Sources/GRPC/GRPCChannel/ClientConnection+NIOSSL.swift +++ b/Sources/GRPC/GRPCChannel/ClientConnection+NIOSSL.swift @@ -14,8 +14,8 @@ * limitations under the License. */ #if canImport(NIOSSL) -import NIOCore -import NIOSSL +@_implementationOnly import NIOCore +@_implementationOnly import NIOSSL extension ClientConnection { /// Returns a `ClientConnection` builder configured with TLS. diff --git a/Sources/GRPC/GRPCChannel/ClientConnection+NWTLS.swift b/Sources/GRPC/GRPCChannel/ClientConnection+NWTLS.swift index 132d8566f..cb38978a2 100644 --- a/Sources/GRPC/GRPCChannel/ClientConnection+NWTLS.swift +++ b/Sources/GRPC/GRPCChannel/ClientConnection+NWTLS.swift @@ -15,7 +15,7 @@ */ #if canImport(Security) #if canImport(Network) -import NIOCore +@_implementationOnly import NIOCore import Security extension ClientConnection { diff --git a/Sources/GRPC/GRPCChannel/GRPCChannel.swift b/Sources/GRPC/GRPCChannel/GRPCChannel.swift index b34ef5c12..bd25f7e01 100644 --- a/Sources/GRPC/GRPCChannel/GRPCChannel.swift +++ b/Sources/GRPC/GRPCChannel/GRPCChannel.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 import SwiftProtobuf public protocol GRPCChannel: GRPCPreconcurrencySendable { diff --git a/Sources/GRPC/GRPCChannel/GRPCChannelBuilder.swift b/Sources/GRPC/GRPCChannel/GRPCChannelBuilder.swift index 67ea2619b..7204f8220 100644 --- a/Sources/GRPC/GRPCChannel/GRPCChannelBuilder.swift +++ b/Sources/GRPC/GRPCChannel/GRPCChannelBuilder.swift @@ -15,7 +15,7 @@ */ import Dispatch import Logging -import NIOCore +@_implementationOnly import NIOCore extension ClientConnection { /// Returns an insecure ``ClientConnection`` builder which is *not configured with TLS*. diff --git a/Sources/GRPC/GRPCClient.swift b/Sources/GRPC/GRPCClient.swift index 783c3f842..89a87a7d8 100644 --- a/Sources/GRPC/GRPCClient.swift +++ b/Sources/GRPC/GRPCClient.swift @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOConcurrencyHelpers -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOConcurrencyHelpers +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 import SwiftProtobuf /// A gRPC client. diff --git a/Sources/GRPC/GRPCClientChannelHandler.swift b/Sources/GRPC/GRPCClientChannelHandler.swift index 15b2c3d17..f35873604 100644 --- a/Sources/GRPC/GRPCClientChannelHandler.swift +++ b/Sources/GRPC/GRPCClientChannelHandler.swift @@ -14,10 +14,10 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 import SwiftProtobuf /// A gRPC client request message part. diff --git a/Sources/GRPC/GRPCClientStateMachine.swift b/Sources/GRPC/GRPCClientStateMachine.swift index b8a4c0a7b..ecf12a557 100644 --- a/Sources/GRPC/GRPCClientStateMachine.swift +++ b/Sources/GRPC/GRPCClientStateMachine.swift @@ -15,9 +15,9 @@ */ import Foundation import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 import SwiftProtobuf enum ReceiveResponseHeadError: Error, Equatable { diff --git a/Sources/GRPC/GRPCIdleHandler.swift b/Sources/GRPC/GRPCIdleHandler.swift index 2690cdcd5..7b53c41cb 100644 --- a/Sources/GRPC/GRPCIdleHandler.swift +++ b/Sources/GRPC/GRPCIdleHandler.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHTTP2 -import NIOTLS +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 +@_implementationOnly import NIOTLS internal final class GRPCIdleHandler: ChannelInboundHandler { typealias InboundIn = HTTP2Frame diff --git a/Sources/GRPC/GRPCIdleHandlerStateMachine.swift b/Sources/GRPC/GRPCIdleHandlerStateMachine.swift index 5a52c14a8..0cf9e7033 100644 --- a/Sources/GRPC/GRPCIdleHandlerStateMachine.swift +++ b/Sources/GRPC/GRPCIdleHandlerStateMachine.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 /// Holds stateĀ for the 'GRPCIdleHandler', this isn't really just the idleness of the connection, /// it also holds state relevant to quiescing the connection as well as logging some HTTP/2 specific diff --git a/Sources/GRPC/GRPCKeepaliveHandlers.swift b/Sources/GRPC/GRPCKeepaliveHandlers.swift index 3fa66ed75..09ed61b08 100644 --- a/Sources/GRPC/GRPCKeepaliveHandlers.swift +++ b/Sources/GRPC/GRPCKeepaliveHandlers.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 struct PingHandler { /// Opaque ping data used for keep-alive pings. diff --git a/Sources/GRPC/GRPCLogger.swift b/Sources/GRPC/GRPCLogger.swift index 2f81fac21..a04982bd8 100644 --- a/Sources/GRPC/GRPCLogger.swift +++ b/Sources/GRPC/GRPCLogger.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Logging -import NIOCore +@_implementationOnly import NIOCore /// Wraps `Logger` to always provide the source as "GRPC". /// diff --git a/Sources/GRPC/GRPCPayload.swift b/Sources/GRPC/GRPCPayload.swift index c356e16f5..3bbce762f 100644 --- a/Sources/GRPC/GRPCPayload.swift +++ b/Sources/GRPC/GRPCPayload.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// A data type which may be serialized into and out from a `ByteBuffer` in order to be sent between /// gRPC peers. diff --git a/Sources/GRPC/GRPCServerPipelineConfigurator.swift b/Sources/GRPC/GRPCServerPipelineConfigurator.swift index a095c36d5..164d9997b 100644 --- a/Sources/GRPC/GRPCServerPipelineConfigurator.swift +++ b/Sources/GRPC/GRPCServerPipelineConfigurator.swift @@ -14,11 +14,11 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 -import NIOHTTP2 -import NIOTLS +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 +@_implementationOnly import NIOTLS /// Configures a server pipeline for gRPC with the appropriate handlers depending on the HTTP /// version used for transport. diff --git a/Sources/GRPC/GRPCServerRequestRoutingHandler.swift b/Sources/GRPC/GRPCServerRequestRoutingHandler.swift index fd0f36157..5305b982b 100644 --- a/Sources/GRPC/GRPCServerRequestRoutingHandler.swift +++ b/Sources/GRPC/GRPCServerRequestRoutingHandler.swift @@ -14,10 +14,10 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 import SwiftProtobuf /// Provides ``GRPCServerHandlerProtocol`` objects for the methods on a particular service name. diff --git a/Sources/GRPC/GRPCStatus.swift b/Sources/GRPC/GRPCStatus.swift index 3087dfd0e..d11f24070 100644 --- a/Sources/GRPC/GRPCStatus.swift +++ b/Sources/GRPC/GRPCStatus.swift @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHTTP1 -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 /// Encapsulates the result of a gRPC call. public struct GRPCStatus: Error, Sendable { diff --git a/Sources/GRPC/GRPCStatusAndMetadata.swift b/Sources/GRPC/GRPCStatusAndMetadata.swift index 04b58c98a..c67528fb3 100644 --- a/Sources/GRPC/GRPCStatusAndMetadata.swift +++ b/Sources/GRPC/GRPCStatusAndMetadata.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK -import NIOHTTP1 +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 /// A simple struct holding a ``GRPCStatus`` and optionally trailers in the form of /// `HPACKHeaders`. diff --git a/Sources/GRPC/GRPCTLSConfiguration.swift b/Sources/GRPC/GRPCTLSConfiguration.swift index 99aebfd74..d883b79ee 100644 --- a/Sources/GRPC/GRPCTLSConfiguration.swift +++ b/Sources/GRPC/GRPCTLSConfiguration.swift @@ -14,13 +14,13 @@ * limitations under the License. */ #if canImport(NIOSSL) -import NIOCore -import NIOSSL +@_implementationOnly import NIOCore +@_implementationOnly import NIOSSL #endif #if canImport(Network) import Network -import NIOTransportServices +@_implementationOnly import NIOTransportServices import Security #endif diff --git a/Sources/GRPC/GRPCTimeout.swift b/Sources/GRPC/GRPCTimeout.swift index fecb22283..a03aaebe3 100644 --- a/Sources/GRPC/GRPCTimeout.swift +++ b/Sources/GRPC/GRPCTimeout.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Dispatch -import NIOCore +@_implementationOnly import NIOCore /// A timeout for a gRPC call. /// diff --git a/Sources/GRPC/GRPCWebToHTTP2ServerCodec.swift b/Sources/GRPC/GRPCWebToHTTP2ServerCodec.swift index 761c307ce..1c8c61a8d 100644 --- a/Sources/GRPC/GRPCWebToHTTP2ServerCodec.swift +++ b/Sources/GRPC/GRPCWebToHTTP2ServerCodec.swift @@ -14,10 +14,10 @@ * limitations under the License. */ import struct Foundation.Data -import NIOCore -import NIOHPACK -import NIOHTTP1 -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 /// A codec for translating between gRPC Web (as HTTP/1) and HTTP/2 frame payloads. internal final class GRPCWebToHTTP2ServerCodec: ChannelDuplexHandler { diff --git a/Sources/GRPC/HTTP2ToRawGRPCServerCodec.swift b/Sources/GRPC/HTTP2ToRawGRPCServerCodec.swift index af424d0c3..32d45204b 100644 --- a/Sources/GRPC/HTTP2ToRawGRPCServerCodec.swift +++ b/Sources/GRPC/HTTP2ToRawGRPCServerCodec.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 internal final class HTTP2ToRawGRPCServerCodec: ChannelInboundHandler, GRPCServerResponseWriter { typealias InboundIn = HTTP2Frame.FramePayload diff --git a/Sources/GRPC/HTTP2ToRawGRPCStateMachine.swift b/Sources/GRPC/HTTP2ToRawGRPCStateMachine.swift index a134c786e..e20970b84 100644 --- a/Sources/GRPC/HTTP2ToRawGRPCStateMachine.swift +++ b/Sources/GRPC/HTTP2ToRawGRPCStateMachine.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 struct HTTP2ToRawGRPCStateMachine { /// The current state. diff --git a/Sources/GRPC/Interceptor/ClientInterceptorContext.swift b/Sources/GRPC/Interceptor/ClientInterceptorContext.swift index bfc192546..f3d9ec14a 100644 --- a/Sources/GRPC/Interceptor/ClientInterceptorContext.swift +++ b/Sources/GRPC/Interceptor/ClientInterceptorContext.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Logging -import NIOCore +@_implementationOnly import NIOCore public struct ClientInterceptorContext { /// The interceptor this context is for. diff --git a/Sources/GRPC/Interceptor/ClientInterceptorPipeline.swift b/Sources/GRPC/Interceptor/ClientInterceptorPipeline.swift index 37de2a928..4d8444ef6 100644 --- a/Sources/GRPC/Interceptor/ClientInterceptorPipeline.swift +++ b/Sources/GRPC/Interceptor/ClientInterceptorPipeline.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 /// A pipeline for intercepting client request and response streams. /// diff --git a/Sources/GRPC/Interceptor/ClientInterceptorProtocol.swift b/Sources/GRPC/Interceptor/ClientInterceptorProtocol.swift index 968d15f15..95f690386 100644 --- a/Sources/GRPC/Interceptor/ClientInterceptorProtocol.swift +++ b/Sources/GRPC/Interceptor/ClientInterceptorProtocol.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore internal protocol ClientInterceptorProtocol { associatedtype Request diff --git a/Sources/GRPC/Interceptor/ClientInterceptors.swift b/Sources/GRPC/Interceptor/ClientInterceptors.swift index 74d567567..7f6243900 100644 --- a/Sources/GRPC/Interceptor/ClientInterceptors.swift +++ b/Sources/GRPC/Interceptor/ClientInterceptors.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// A base class for client interceptors. /// diff --git a/Sources/GRPC/Interceptor/ClientTransport.swift b/Sources/GRPC/Interceptor/ClientTransport.swift index 0387d1ca0..626a1a0fe 100644 --- a/Sources/GRPC/Interceptor/ClientTransport.swift +++ b/Sources/GRPC/Interceptor/ClientTransport.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 /// This class is the glue between a `NIO.Channel` and the `ClientInterceptorPipeline`. In fact /// this object owns the interceptor pipeline and is also a `ChannelHandler`. The caller has very diff --git a/Sources/GRPC/Interceptor/ClientTransportFactory.swift b/Sources/GRPC/Interceptor/ClientTransportFactory.swift index 85feb8d72..26a6b8031 100644 --- a/Sources/GRPC/Interceptor/ClientTransportFactory.swift +++ b/Sources/GRPC/Interceptor/ClientTransportFactory.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP2 import protocol SwiftProtobuf.Message /// A `ClientTransport` factory for an RPC. diff --git a/Sources/GRPC/Interceptor/MessageParts.swift b/Sources/GRPC/Interceptor/MessageParts.swift index 1e2495884..9b1b167bc 100644 --- a/Sources/GRPC/Interceptor/MessageParts.swift +++ b/Sources/GRPC/Interceptor/MessageParts.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK public enum GRPCClientRequestPart { /// User provided metadata sent at the start of the request stream. diff --git a/Sources/GRPC/Interceptor/ServerInterceptorContext.swift b/Sources/GRPC/Interceptor/ServerInterceptorContext.swift index 5543b417f..efd6c2426 100644 --- a/Sources/GRPC/Interceptor/ServerInterceptorContext.swift +++ b/Sources/GRPC/Interceptor/ServerInterceptorContext.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Logging -import NIOCore +@_implementationOnly import NIOCore public struct ServerInterceptorContext { /// The interceptor this context is for. diff --git a/Sources/GRPC/Interceptor/ServerInterceptorPipeline.swift b/Sources/GRPC/Interceptor/ServerInterceptorPipeline.swift index 863c63941..c4f1d6deb 100644 --- a/Sources/GRPC/Interceptor/ServerInterceptorPipeline.swift +++ b/Sources/GRPC/Interceptor/ServerInterceptorPipeline.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Logging -import NIOCore +@_implementationOnly import NIOCore @usableFromInline internal final class ServerInterceptorPipeline { diff --git a/Sources/GRPC/Interceptor/ServerInterceptors.swift b/Sources/GRPC/Interceptor/ServerInterceptors.swift index 835f34ded..b7dd7a3a6 100644 --- a/Sources/GRPC/Interceptor/ServerInterceptors.swift +++ b/Sources/GRPC/Interceptor/ServerInterceptors.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// A base class for server interceptors. /// diff --git a/Sources/GRPC/LengthPrefixedMessageReader.swift b/Sources/GRPC/LengthPrefixedMessageReader.swift index c3f49c47e..d48ed7855 100644 --- a/Sources/GRPC/LengthPrefixedMessageReader.swift +++ b/Sources/GRPC/LengthPrefixedMessageReader.swift @@ -15,8 +15,8 @@ */ import Foundation import Logging -import NIOCore -import NIOHTTP1 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP1 /// This class reads and decodes length-prefixed gRPC messages. /// diff --git a/Sources/GRPC/Logger.swift b/Sources/GRPC/Logger.swift index 030a8af55..b339aff72 100644 --- a/Sources/GRPC/Logger.swift +++ b/Sources/GRPC/Logger.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Logging -import NIOCore +@_implementationOnly import NIOCore /// Keys for `Logger` metadata. enum MetadataKey { diff --git a/Sources/GRPC/PlatformSupport.swift b/Sources/GRPC/PlatformSupport.swift index 6f9b1a163..436f8da3a 100644 --- a/Sources/GRPC/PlatformSupport.swift +++ b/Sources/GRPC/PlatformSupport.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOPosix -import NIOTransportServices +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix +@_implementationOnly import NIOTransportServices /// How a network implementation should be chosen. public struct NetworkPreference: Hashable { diff --git a/Sources/GRPC/ReadWriteStates.swift b/Sources/GRPC/ReadWriteStates.swift index 62456f7cf..f40513c66 100644 --- a/Sources/GRPC/ReadWriteStates.swift +++ b/Sources/GRPC/ReadWriteStates.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore import SwiftProtobuf /// Number of messages expected on a stream. diff --git a/Sources/GRPC/Serialization.swift b/Sources/GRPC/Serialization.swift index 641ac86f9..d1ac5e508 100644 --- a/Sources/GRPC/Serialization.swift +++ b/Sources/GRPC/Serialization.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import struct Foundation.Data -import NIOCore -import NIOFoundationCompat +@_implementationOnly import NIOCore +@_implementationOnly import NIOFoundationCompat import SwiftProtobuf public protocol MessageSerializer { diff --git a/Sources/GRPC/Server+NIOSSL.swift b/Sources/GRPC/Server+NIOSSL.swift index 5656ca744..cf5404703 100644 --- a/Sources/GRPC/Server+NIOSSL.swift +++ b/Sources/GRPC/Server+NIOSSL.swift @@ -14,7 +14,7 @@ * limitations under the License. */ #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL extension Server.Configuration { /// TLS configuration for a ``Server``. diff --git a/Sources/GRPC/Server.swift b/Sources/GRPC/Server.swift index 1d1c89c7c..1c740eae0 100644 --- a/Sources/GRPC/Server.swift +++ b/Sources/GRPC/Server.swift @@ -15,15 +15,15 @@ */ import Foundation import Logging -import NIOCore -import NIOExtras -import NIOHTTP1 -import NIOHTTP2 -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOExtras +@_implementationOnly import NIOHTTP1 +@_implementationOnly import NIOHTTP2 +@_implementationOnly import NIOPosix #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif -import NIOTransportServices +@_implementationOnly import NIOTransportServices #if canImport(Network) import Network #endif diff --git a/Sources/GRPC/ServerBuilder+NIOSSL.swift b/Sources/GRPC/ServerBuilder+NIOSSL.swift index c71badbde..b764801d6 100644 --- a/Sources/GRPC/ServerBuilder+NIOSSL.swift +++ b/Sources/GRPC/ServerBuilder+NIOSSL.swift @@ -14,8 +14,8 @@ * limitations under the License. */ #if canImport(NIOSSL) -import NIOCore -import NIOSSL +@_implementationOnly import NIOCore +@_implementationOnly import NIOSSL extension Server { /// Returns a `Server` builder configured with TLS. diff --git a/Sources/GRPC/ServerBuilder.swift b/Sources/GRPC/ServerBuilder.swift index 1600335c8..6208fdb29 100644 --- a/Sources/GRPC/ServerBuilder.swift +++ b/Sources/GRPC/ServerBuilder.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Logging -import NIOCore +@_implementationOnly import NIOCore #if canImport(Network) import Security diff --git a/Sources/GRPC/ServerCallContexts/ServerCallContext.swift b/Sources/GRPC/ServerCallContexts/ServerCallContext.swift index 603442e1d..1eb13e0f5 100644 --- a/Sources/GRPC/ServerCallContexts/ServerCallContext.swift +++ b/Sources/GRPC/ServerCallContexts/ServerCallContext.swift @@ -15,9 +15,9 @@ */ import Foundation import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 import SwiftProtobuf /// Protocol declaring a minimum set of properties exposed by *all* types of call contexts. diff --git a/Sources/GRPC/ServerCallContexts/StreamingResponseCallContext.swift b/Sources/GRPC/ServerCallContexts/StreamingResponseCallContext.swift index 1dcfa6aa4..586ddb977 100644 --- a/Sources/GRPC/ServerCallContexts/StreamingResponseCallContext.swift +++ b/Sources/GRPC/ServerCallContexts/StreamingResponseCallContext.swift @@ -15,9 +15,9 @@ */ import Foundation import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 import SwiftProtobuf /// An abstract base class for a context provided to handlers for RPCs which may return multiple diff --git a/Sources/GRPC/ServerCallContexts/UnaryResponseCallContext.swift b/Sources/GRPC/ServerCallContexts/UnaryResponseCallContext.swift index 9e3a3a892..b72e2168e 100644 --- a/Sources/GRPC/ServerCallContexts/UnaryResponseCallContext.swift +++ b/Sources/GRPC/ServerCallContexts/UnaryResponseCallContext.swift @@ -15,9 +15,9 @@ */ import Foundation import Logging -import NIOCore -import NIOHPACK -import NIOHTTP1 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 import SwiftProtobuf /// A context provided to handlers for RPCs which return a single response, i.e. unary and client diff --git a/Sources/GRPC/ServerChannelErrorHandler.swift b/Sources/GRPC/ServerChannelErrorHandler.swift index b37b7ecea..f08bd397f 100644 --- a/Sources/GRPC/ServerChannelErrorHandler.swift +++ b/Sources/GRPC/ServerChannelErrorHandler.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// A handler that passes errors thrown into the server channel to the server error delegate. /// diff --git a/Sources/GRPC/ServerErrorDelegate.swift b/Sources/GRPC/ServerErrorDelegate.swift index c9c8e15a3..f7e58311a 100644 --- a/Sources/GRPC/ServerErrorDelegate.swift +++ b/Sources/GRPC/ServerErrorDelegate.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import Foundation -import NIOCore -import NIOHPACK -import NIOHTTP1 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP1 public protocol ServerErrorDelegate: AnyObject { //! FIXME: Provide more context about where the error was thrown, i.e. using `GRPCError`. diff --git a/Sources/GRPC/ServerErrorProcessor.swift b/Sources/GRPC/ServerErrorProcessor.swift index 34f98e846..a6ce08ae3 100644 --- a/Sources/GRPC/ServerErrorProcessor.swift +++ b/Sources/GRPC/ServerErrorProcessor.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOHPACK +@_implementationOnly import NIOHPACK @usableFromInline internal enum ServerErrorProcessor { diff --git a/Sources/GRPC/TLSVerificationHandler.swift b/Sources/GRPC/TLSVerificationHandler.swift index c8b200449..42c226e5b 100644 --- a/Sources/GRPC/TLSVerificationHandler.swift +++ b/Sources/GRPC/TLSVerificationHandler.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOTLS +@_implementationOnly import NIOCore +@_implementationOnly import NIOTLS /// Application protocol identifiers for ALPN. internal enum GRPCApplicationProtocolIdentifier { diff --git a/Sources/GRPC/TLSVersion.swift b/Sources/GRPC/TLSVersion.swift index 9be80c77f..43562ce3a 100644 --- a/Sources/GRPC/TLSVersion.swift +++ b/Sources/GRPC/TLSVersion.swift @@ -14,13 +14,13 @@ * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif #if canImport(Network) import Network -import NIOTransportServices +@_implementationOnly import NIOTransportServices #endif // The same as 'TLSVersion' which is defined in NIOSSL which we don't always have. diff --git a/Sources/GRPC/TimeLimit.swift b/Sources/GRPC/TimeLimit.swift index 7ea6e1de1..25c1928e2 100644 --- a/Sources/GRPC/TimeLimit.swift +++ b/Sources/GRPC/TimeLimit.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import Dispatch -import NIOCore +@_implementationOnly import NIOCore /// A time limit for an RPC. /// diff --git a/Sources/GRPC/WebCORSHandler.swift b/Sources/GRPC/WebCORSHandler.swift index 7f586ed24..830fd99a8 100644 --- a/Sources/GRPC/WebCORSHandler.swift +++ b/Sources/GRPC/WebCORSHandler.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOHTTP1 +@_implementationOnly import NIOCore +@_implementationOnly import NIOHTTP1 /// Handler that manages the CORS protocol for requests incoming from the browser. internal final class WebCORSHandler { diff --git a/Sources/GRPC/WriteCapturingHandler.swift b/Sources/GRPC/WriteCapturingHandler.swift index c8ed4e88e..e3f6ba00f 100644 --- a/Sources/GRPC/WriteCapturingHandler.swift +++ b/Sources/GRPC/WriteCapturingHandler.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// A handler which redirects all writes into a callback until the `.end` part is seen, after which /// all writes will be failed. diff --git a/Sources/GRPC/_EmbeddedThroughput.swift b/Sources/GRPC/_EmbeddedThroughput.swift index f6e4ed827..ac0cfd988 100644 --- a/Sources/GRPC/_EmbeddedThroughput.swift +++ b/Sources/GRPC/_EmbeddedThroughput.swift @@ -14,8 +14,8 @@ * limitations under the License. */ import Logging -import NIOCore -import NIOEmbedded +@_implementationOnly import NIOCore +@_implementationOnly import NIOEmbedded import SwiftProtobuf extension EmbeddedChannel { diff --git a/Sources/GRPC/_FakeResponseStream.swift b/Sources/GRPC/_FakeResponseStream.swift index 5a2f5b282..22e88e335 100644 --- a/Sources/GRPC/_FakeResponseStream.swift +++ b/Sources/GRPC/_FakeResponseStream.swift @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore -import NIOEmbedded -import NIOHPACK +@_implementationOnly import NIOCore +@_implementationOnly import NIOEmbedded +@_implementationOnly import NIOHPACK public enum FakeRequestPart { case metadata(HPACKHeaders) diff --git a/Sources/GRPC/_GRPCClientCodecHandler.swift b/Sources/GRPC/_GRPCClientCodecHandler.swift index f1e1dd43c..624104a4f 100644 --- a/Sources/GRPC/_GRPCClientCodecHandler.swift +++ b/Sources/GRPC/_GRPCClientCodecHandler.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore internal class GRPCClientCodecHandler< Serializer: MessageSerializer, diff --git a/Sources/GRPCConnectionBackoffInteropTest/main.swift b/Sources/GRPCConnectionBackoffInteropTest/main.swift index e719dd699..3917c1137 100644 --- a/Sources/GRPCConnectionBackoffInteropTest/main.swift +++ b/Sources/GRPCConnectionBackoffInteropTest/main.swift @@ -19,8 +19,8 @@ import struct Foundation.Date import GRPC import GRPCInteroperabilityTestModels import Logging -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix // Notes from the test procedure are inline. // See: https://github.com/grpc/grpc/blob/master/doc/connection-backoff-interop-test-description.md diff --git a/Sources/GRPCInteroperabilityTestModels/Generated/test.grpc.swift b/Sources/GRPCInteroperabilityTestModels/Generated/test.grpc.swift index 6f0522adc..cc559c82f 100644 --- a/Sources/GRPCInteroperabilityTestModels/Generated/test.grpc.swift +++ b/Sources/GRPCInteroperabilityTestModels/Generated/test.grpc.swift @@ -6,8 +6,8 @@ // Source: src/proto/grpc/testing/test.proto // import GRPC -import NIO -import NIOConcurrencyHelpers +@_implementationOnly import NIO +@_implementationOnly import NIOConcurrencyHelpers import SwiftProtobuf diff --git a/Sources/GRPCInteroperabilityTests/main.swift b/Sources/GRPCInteroperabilityTests/main.swift index e50de8fb8..30434f3b7 100644 --- a/Sources/GRPCInteroperabilityTests/main.swift +++ b/Sources/GRPCInteroperabilityTests/main.swift @@ -18,8 +18,8 @@ import Foundation import GRPC import GRPCInteroperabilityTestsImplementation import Logging -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix // Reduce stdout noise. LoggingSystem.bootstrap(StreamLogHandler.standardError) diff --git a/Sources/GRPCInteroperabilityTestsImplementation/Assertions.swift b/Sources/GRPCInteroperabilityTestsImplementation/Assertions.swift index 181f9b0f4..72efd8de1 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/Assertions.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/Assertions.swift @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import NIOCore +@_implementationOnly import NIOCore /// Assertion error for interoperability testing. /// diff --git a/Sources/GRPCInteroperabilityTestsImplementation/GRPCTestingConvenienceMethods.swift b/Sources/GRPCInteroperabilityTestsImplementation/GRPCTestingConvenienceMethods.swift index 1c7dbae1c..e99dc441a 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/GRPCTestingConvenienceMethods.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/GRPCTestingConvenienceMethods.swift @@ -15,7 +15,7 @@ */ import struct Foundation.Data import GRPCInteroperabilityTestModels -import NIOHPACK +@_implementationOnly import NIOHPACK import SwiftProtobuf // MARK: - Payload creation diff --git a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCase.swift b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCase.swift index 8e19856b2..d25c19705 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCase.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCase.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import GRPC -import NIOCore +@_implementationOnly import NIOCore public protocol InteroperabilityTest { /// Run a test case using the given connection. diff --git a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCases.swift b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCases.swift index eab6be6fd..e25c9c696 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCases.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCases.swift @@ -17,7 +17,7 @@ import Dispatch import struct Foundation.Data import GRPC import GRPCInteroperabilityTestModels -import NIOHPACK +@_implementationOnly import NIOHPACK /// This test verifies that implementations support zero-size messages. Ideally, client /// implementations would verify that the request and response were zero bytes serialized, but diff --git a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestClientConnection.swift b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestClientConnection.swift index 5d5a2cfff..d73a0ec1f 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestClientConnection.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestClientConnection.swift @@ -14,9 +14,9 @@ * limitations under the License. */ import GRPC -import NIOCore +@_implementationOnly import NIOCore #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif public func makeInteroperabilityTestClientBuilder( diff --git a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCredentials.swift b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCredentials.swift index 9afa3dc5c..26afcb21f 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCredentials.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestCredentials.swift @@ -14,7 +14,7 @@ * limitations under the License. */ #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL /// Contains credentials used for the gRPC interoperability tests. /// diff --git a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestServer.swift b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestServer.swift index 63fd6836d..413b911b0 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestServer.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/InteroperabilityTestServer.swift @@ -15,9 +15,9 @@ */ import GRPC import Logging -import NIOCore +@_implementationOnly import NIOCore #if canImport(NIOSSL) -import NIOSSL +@_implementationOnly import NIOSSL #endif /// Makes a server for gRPC interoperability testing. diff --git a/Sources/GRPCInteroperabilityTestsImplementation/TestServiceAsyncProvider.swift b/Sources/GRPCInteroperabilityTestsImplementation/TestServiceAsyncProvider.swift index 1df7f6f7a..b6059fa86 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/TestServiceAsyncProvider.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/TestServiceAsyncProvider.swift @@ -16,7 +16,7 @@ import Foundation import GRPC import GRPCInteroperabilityTestModels -import NIOCore +@_implementationOnly import NIOCore /// An async service provider for the gRPC interoperability test suite. /// diff --git a/Sources/GRPCInteroperabilityTestsImplementation/TestServiceProvider.swift b/Sources/GRPCInteroperabilityTestsImplementation/TestServiceProvider.swift index 7b98a29fb..0816c2d26 100644 --- a/Sources/GRPCInteroperabilityTestsImplementation/TestServiceProvider.swift +++ b/Sources/GRPCInteroperabilityTestsImplementation/TestServiceProvider.swift @@ -16,7 +16,7 @@ import struct Foundation.Data import GRPC import GRPCInteroperabilityTestModels -import NIOCore +@_implementationOnly import NIOCore /// A service provider for the gRPC interoperability test suite. /// diff --git a/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift b/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift index e3369b9f8..c7dcfd7fd 100644 --- a/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift +++ b/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift @@ -16,10 +16,10 @@ import struct Foundation.Data import GRPC import Logging -import NIOCore -import NIOEmbedded -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOEmbedded +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 /// Tests the throughput on the client side by firing a unary request through an embedded channel /// and writing back enough gRPC as HTTP/2 frames to get through the state machine. diff --git a/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedServer.swift b/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedServer.swift index fd4748667..7324d9733 100644 --- a/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedServer.swift +++ b/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedServer.swift @@ -15,10 +15,10 @@ */ import GRPC import Logging -import NIOCore -import NIOEmbedded -import NIOHPACK -import NIOHTTP2 +@_implementationOnly import NIOCore +@_implementationOnly import NIOEmbedded +@_implementationOnly import NIOHPACK +@_implementationOnly import NIOHTTP2 final class EmbeddedServerChildChannelBenchmark: Benchmark { private let text: String diff --git a/Sources/GRPCPerformanceTests/Benchmarks/MinimalEchoProvider.swift b/Sources/GRPCPerformanceTests/Benchmarks/MinimalEchoProvider.swift index 7de34a186..469d4501c 100644 --- a/Sources/GRPCPerformanceTests/Benchmarks/MinimalEchoProvider.swift +++ b/Sources/GRPCPerformanceTests/Benchmarks/MinimalEchoProvider.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import GRPC -import NIOCore +@_implementationOnly import NIOCore /// The echo provider that comes with the example does some string processing, we'll avoid some of /// that here so we're looking at the right things. diff --git a/Sources/GRPCPerformanceTests/Benchmarks/PercentEncoding.swift b/Sources/GRPCPerformanceTests/Benchmarks/PercentEncoding.swift index 37c341434..cb32e7040 100644 --- a/Sources/GRPCPerformanceTests/Benchmarks/PercentEncoding.swift +++ b/Sources/GRPCPerformanceTests/Benchmarks/PercentEncoding.swift @@ -14,7 +14,7 @@ * limitations under the License. */ import GRPC -import NIOCore +@_implementationOnly import NIOCore class PercentEncoding: Benchmark { let message: String diff --git a/Sources/GRPCPerformanceTests/Benchmarks/ServerProvidingBenchmark.swift b/Sources/GRPCPerformanceTests/Benchmarks/ServerProvidingBenchmark.swift index e8754386e..208a1b8d4 100644 --- a/Sources/GRPCPerformanceTests/Benchmarks/ServerProvidingBenchmark.swift +++ b/Sources/GRPCPerformanceTests/Benchmarks/ServerProvidingBenchmark.swift @@ -15,8 +15,8 @@ */ import GRPC import GRPCSampleData -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix class ServerProvidingBenchmark: Benchmark { private let providers: [CallHandlerProvider] diff --git a/Sources/GRPCPerformanceTests/Benchmarks/UnaryThroughput.swift b/Sources/GRPCPerformanceTests/Benchmarks/UnaryThroughput.swift index 8ee6b46ad..432c438fd 100644 --- a/Sources/GRPCPerformanceTests/Benchmarks/UnaryThroughput.swift +++ b/Sources/GRPCPerformanceTests/Benchmarks/UnaryThroughput.swift @@ -15,8 +15,8 @@ */ import GRPC import GRPCSampleData -import NIOCore -import NIOPosix +@_implementationOnly import NIOCore +@_implementationOnly import NIOPosix /// Tests unary throughput by sending requests on a single connection. /// diff --git a/Sources/GRPCSampleData/GRPCSwiftCertificate.swift b/Sources/GRPCSampleData/GRPCSwiftCertificate.swift index 3294ae96f..87a94f643 100644 --- a/Sources/GRPCSampleData/GRPCSwiftCertificate.swift +++ b/Sources/GRPCSampleData/GRPCSwiftCertificate.swift @@ -22,7 +22,7 @@ #if canImport(NIOSSL) import struct Foundation.Date -import NIOSSL +@_implementationOnly import NIOSSL /// Wraps `NIOSSLCertificate` to provide the certificate common name and expiry date. public struct SampleCertificate {