Skip to content

Commit 5a22431

Browse files
authored
Regenerate and update dependencies (#26)
1 parent 0046afa commit 5a22431

File tree

14 files changed

+125
-52
lines changed

14 files changed

+125
-52
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ let products: [Product] = [
3939
let dependencies: [Package.Dependency] = [
4040
.package(
4141
url: "https://github.com/grpc/grpc-swift.git",
42-
exact: "2.0.0-beta.2"
42+
branch: "main"
4343
),
4444
.package(
4545
url: "https://github.com/grpc/grpc-swift-protobuf.git",
46-
exact: "1.0.0-beta.2"
46+
branch: "main"
4747
),
4848
.package(
4949
url: "https://github.com/apple/swift-protobuf.git",

Sources/GRPCHealthService/Generated/health.grpc.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ extension Grpc_Health_V1_Health {
299299

300300
// Default implementation of 'registerMethods(with:)'.
301301
extension Grpc_Health_V1_Health.StreamingServiceProtocol {
302-
package func registerMethods(with router: inout GRPCCore.RPCRouter) {
302+
package func registerMethods<Transport>(with router: inout GRPCCore.RPCRouter<Transport>) where Transport: GRPCCore.ServerTransport {
303303
router.registerHandler(
304304
forMethod: Grpc_Health_V1_Health.Method.Check.descriptor,
305305
deserializer: GRPCProtobuf.ProtobufDeserializer<Grpc_Health_V1_HealthCheckRequest>(),
@@ -477,14 +477,14 @@ extension Grpc_Health_V1_Health {
477477
/// > Health is gRPC's mechanism for checking whether a server is able to handle
478478
/// > RPCs. Its semantics are documented in
479479
/// > https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
480-
package struct Client: ClientProtocol {
481-
private let client: GRPCCore.GRPCClient
480+
package struct Client<Transport>: ClientProtocol where Transport: GRPCCore.ClientTransport {
481+
private let client: GRPCCore.GRPCClient<Transport>
482482

483483
/// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
484484
///
485485
/// - Parameters:
486486
/// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
487-
package init(wrapping client: GRPCCore.GRPCClient) {
487+
package init(wrapping client: GRPCCore.GRPCClient<Transport>) {
488488
self.client = client
489489
}
490490

Sources/GRPCHealthService/HealthService.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ public struct HealthService: Sendable, RegistrableRPCService {
5555
self.provider = HealthService.Provider(healthService: healthService)
5656
}
5757

58-
public func registerMethods(with router: inout RPCRouter) {
58+
public func registerMethods<Transport>(
59+
with router: inout RPCRouter<Transport>
60+
) where Transport: ServerTransport {
5961
self.service.registerMethods(with: &router)
6062
}
6163
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2015 gRPC authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// DO NOT EDIT.
16+
// swift-format-ignore-file
17+
//
18+
// Generated by the gRPC Swift generator plugin for the protocol buffer compiler.
19+
// Source: src/proto/grpc/testing/empty.proto
20+
//
21+
// For information on using the generated types, please see the documentation:
22+
// https://github.com/grpc/grpc-swift
23+
24+
// This file contained no services.

Sources/GRPCInteropTests/Generated/empty_service.grpc.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ extension Grpc_Testing_EmptyService {
9191

9292
// Default implementation of 'registerMethods(with:)'.
9393
extension Grpc_Testing_EmptyService.StreamingServiceProtocol {
94-
public func registerMethods(with router: inout GRPCCore.RPCRouter) {}
94+
public func registerMethods<Transport>(with router: inout GRPCCore.RPCRouter<Transport>) where Transport: GRPCCore.ServerTransport {}
9595
}
9696

9797
// Default implementation of streaming methods from 'StreamingServiceProtocol'.
@@ -126,14 +126,14 @@ extension Grpc_Testing_EmptyService {
126126
/// >
127127
/// > A service that has zero methods.
128128
/// > See https://github.com/grpc/grpc/issues/15574
129-
public struct Client: ClientProtocol {
130-
private let client: GRPCCore.GRPCClient
129+
public struct Client<Transport>: ClientProtocol where Transport: GRPCCore.ClientTransport {
130+
private let client: GRPCCore.GRPCClient<Transport>
131131

132132
/// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
133133
///
134134
/// - Parameters:
135135
/// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
136-
public init(wrapping client: GRPCCore.GRPCClient) {
136+
public init(wrapping client: GRPCCore.GRPCClient<Transport>) {
137137
self.client = client
138138
}
139139
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2015-2016 gRPC authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Message definitions to be used by integration test service definitions.
16+
17+
// DO NOT EDIT.
18+
// swift-format-ignore-file
19+
//
20+
// Generated by the gRPC Swift generator plugin for the protocol buffer compiler.
21+
// Source: src/proto/grpc/testing/messages.proto
22+
//
23+
// For information on using the generated types, please see the documentation:
24+
// https://github.com/grpc/grpc-swift
25+
26+
// This file contained no services.

Sources/GRPCInteropTests/Generated/test.grpc.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ extension Grpc_Testing_TestService {
664664

665665
// Default implementation of 'registerMethods(with:)'.
666666
extension Grpc_Testing_TestService.StreamingServiceProtocol {
667-
public func registerMethods(with router: inout GRPCCore.RPCRouter) {
667+
public func registerMethods<Transport>(with router: inout GRPCCore.RPCRouter<Transport>) where Transport: GRPCCore.ServerTransport {
668668
router.registerHandler(
669669
forMethod: Grpc_Testing_TestService.Method.EmptyCall.descriptor,
670670
deserializer: GRPCProtobuf.ProtobufDeserializer<Grpc_Testing_Empty>(),
@@ -1162,14 +1162,14 @@ extension Grpc_Testing_TestService {
11621162
/// >
11631163
/// > A simple service to test the various types of RPCs and experiment with
11641164
/// > performance with various types of payload.
1165-
public struct Client: ClientProtocol {
1166-
private let client: GRPCCore.GRPCClient
1165+
public struct Client<Transport>: ClientProtocol where Transport: GRPCCore.ClientTransport {
1166+
private let client: GRPCCore.GRPCClient<Transport>
11671167

11681168
/// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
11691169
///
11701170
/// - Parameters:
11711171
/// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
1172-
public init(wrapping client: GRPCCore.GRPCClient) {
1172+
public init(wrapping client: GRPCCore.GRPCClient<Transport>) {
11731173
self.client = client
11741174
}
11751175

@@ -2099,7 +2099,7 @@ extension Grpc_Testing_UnimplementedService {
20992099

21002100
// Default implementation of 'registerMethods(with:)'.
21012101
extension Grpc_Testing_UnimplementedService.StreamingServiceProtocol {
2102-
public func registerMethods(with router: inout GRPCCore.RPCRouter) {
2102+
public func registerMethods<Transport>(with router: inout GRPCCore.RPCRouter<Transport>) where Transport: GRPCCore.ServerTransport {
21032103
router.registerHandler(
21042104
forMethod: Grpc_Testing_UnimplementedService.Method.UnimplementedCall.descriptor,
21052105
deserializer: GRPCProtobuf.ProtobufDeserializer<Grpc_Testing_Empty>(),
@@ -2191,14 +2191,14 @@ extension Grpc_Testing_UnimplementedService {
21912191
/// >
21922192
/// > A simple service NOT implemented at servers so clients can test for
21932193
/// > that case.
2194-
public struct Client: ClientProtocol {
2195-
private let client: GRPCCore.GRPCClient
2194+
public struct Client<Transport>: ClientProtocol where Transport: GRPCCore.ClientTransport {
2195+
private let client: GRPCCore.GRPCClient<Transport>
21962196

21972197
/// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
21982198
///
21992199
/// - Parameters:
22002200
/// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
2201-
public init(wrapping client: GRPCCore.GRPCClient) {
2201+
public init(wrapping client: GRPCCore.GRPCClient<Transport>) {
22022202
self.client = client
22032203
}
22042204

@@ -2481,7 +2481,7 @@ extension Grpc_Testing_ReconnectService {
24812481

24822482
// Default implementation of 'registerMethods(with:)'.
24832483
extension Grpc_Testing_ReconnectService.StreamingServiceProtocol {
2484-
public func registerMethods(with router: inout GRPCCore.RPCRouter) {
2484+
public func registerMethods<Transport>(with router: inout GRPCCore.RPCRouter<Transport>) where Transport: GRPCCore.ServerTransport {
24852485
router.registerHandler(
24862486
forMethod: Grpc_Testing_ReconnectService.Method.Start.descriptor,
24872487
deserializer: GRPCProtobuf.ProtobufDeserializer<Grpc_Testing_ReconnectParams>(),
@@ -2621,14 +2621,14 @@ extension Grpc_Testing_ReconnectService {
26212621
/// > Source IDL Documentation:
26222622
/// >
26232623
/// > A service used to control reconnect server.
2624-
public struct Client: ClientProtocol {
2625-
private let client: GRPCCore.GRPCClient
2624+
public struct Client<Transport>: ClientProtocol where Transport: GRPCCore.ClientTransport {
2625+
private let client: GRPCCore.GRPCClient<Transport>
26262626

26272627
/// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
26282628
///
26292629
/// - Parameters:
26302630
/// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
2631-
public init(wrapping client: GRPCCore.GRPCClient) {
2631+
public init(wrapping client: GRPCCore.GRPCClient<Transport>) {
26322632
self.client = client
26332633
}
26342634

Sources/GRPCInteropTests/InteroperabilityTestCase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public protocol InteroperabilityTest {
2323
///
2424
/// - Parameter client: The client to use for the test.
2525
/// - Throws: Any exception may be thrown to indicate an unsuccessful test.
26-
func run(client: GRPCClient) async throws
26+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws
2727
}
2828

2929
/// Test cases as listed by the [gRPC interoperability test description specification]

Sources/GRPCInteropTests/InteroperabilityTestCases.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private import struct Foundation.Data
3737
/// - call was successful
3838
/// - response is non-null
3939
struct EmptyUnary: InteroperabilityTest {
40-
func run(client: GRPCClient) async throws {
40+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
4141
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
4242
try await testServiceClient.emptyCall(
4343
request: ClientRequest(message: Grpc_Testing_Empty())
@@ -70,7 +70,7 @@ struct EmptyUnary: InteroperabilityTest {
7070
/// - clients are free to assert that the response payload body contents are zero and comparing
7171
/// the entire response message against a golden response
7272
struct LargeUnary: InteroperabilityTest {
73-
func run(client: GRPCClient) async throws {
73+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
7474
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
7575
let request = Grpc_Testing_SimpleRequest.with { request in
7676
request.responseSize = 314_159
@@ -145,7 +145,7 @@ struct LargeUnary: InteroperabilityTest {
145145
/// - Clients are free to assert that the response payload body contents are zeros and comparing the
146146
/// entire response message against a golden response.
147147
class ClientCompressedUnary: InteroperabilityTest {
148-
func run(client: GRPCClient) async throws {
148+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
149149
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
150150
let compressedRequest = Grpc_Testing_SimpleRequest.with { request in
151151
request.expectCompressed = .with { $0.value = true }
@@ -253,7 +253,7 @@ class ClientCompressedUnary: InteroperabilityTest {
253253
/// - clients are free to assert that the response payload body contents are zero and comparing the
254254
/// entire response message against a golden response
255255
class ServerCompressedUnary: InteroperabilityTest {
256-
func run(client: GRPCClient) async throws {
256+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
257257
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
258258

259259
let compressedRequest = Grpc_Testing_SimpleRequest.with { request in
@@ -342,7 +342,7 @@ class ServerCompressedUnary: InteroperabilityTest {
342342
/// - call was successful
343343
/// - response aggregated_payload_size is 74922
344344
struct ClientStreaming: InteroperabilityTest {
345-
func run(client: GRPCClient) async throws {
345+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
346346
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
347347
let request = StreamingClientRequest { writer in
348348
for bytes in [27182, 8, 1828, 45904] {
@@ -392,7 +392,7 @@ struct ClientStreaming: InteroperabilityTest {
392392
/// - clients are free to assert that the response payload body contents are zero and
393393
/// comparing the entire response messages against golden responses
394394
struct ServerStreaming: InteroperabilityTest {
395-
func run(client: GRPCClient) async throws {
395+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
396396
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
397397
let responseSizes = [31415, 9, 2653, 58979]
398398
let request = Grpc_Testing_StreamingOutputCallRequest.with { request in
@@ -467,7 +467,7 @@ struct ServerStreaming: InteroperabilityTest {
467467
/// - clients are free to assert that the response payload body contents are zero and comparing the
468468
/// entire response messages against golden responses
469469
class ServerCompressedStreaming: InteroperabilityTest {
470-
func run(client: GRPCClient) async throws {
470+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
471471
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
472472
let request: Grpc_Testing_StreamingOutputCallRequest = .with { request in
473473
request.responseParameters = [
@@ -579,7 +579,7 @@ class ServerCompressedStreaming: InteroperabilityTest {
579579
/// - clients are free to assert that the response payload body contents are zero and
580580
/// comparing the entire response messages against golden responses
581581
struct PingPong: InteroperabilityTest {
582-
func run(client: GRPCClient) async throws {
582+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
583583
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
584584
let ids = AsyncStream.makeStream(of: Int.self)
585585

@@ -645,7 +645,7 @@ struct PingPong: InteroperabilityTest {
645645
/// - call was successful
646646
/// - exactly zero responses
647647
struct EmptyStream: InteroperabilityTest {
648-
func run(client: GRPCClient) async throws {
648+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
649649
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
650650
let request = StreamingClientRequest<Grpc_Testing_StreamingOutputCallRequest> { _ in }
651651

@@ -716,7 +716,7 @@ struct CustomMetadata: InteroperabilityTest {
716716
try assertEqual(Array(values), [.binary(self.trailingMetadataValue)])
717717
}
718718

719-
func run(client: GRPCClient) async throws {
719+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
720720
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
721721

722722
let unaryRequest = Grpc_Testing_SimpleRequest.with { request in
@@ -823,7 +823,7 @@ struct StatusCodeAndMessage: InteroperabilityTest {
823823
let expectedCode = 2
824824
let expectedMessage = "test status message"
825825

826-
func run(client: GRPCClient) async throws {
826+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
827827
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
828828

829829
let message = Grpc_Testing_SimpleRequest.with {
@@ -897,7 +897,7 @@ struct StatusCodeAndMessage: InteroperabilityTest {
897897
/// - received status message is the same as the sent message for Procedure step 1, including all
898898
/// whitespace characters
899899
struct SpecialStatusMessage: InteroperabilityTest {
900-
func run(client: GRPCClient) async throws {
900+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
901901
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
902902

903903
let responseMessage = "\t\ntest with whitespace\r\nand Unicode BMP ☺ and non-BMP 😈\t\n"
@@ -939,7 +939,7 @@ struct SpecialStatusMessage: InteroperabilityTest {
939939
/// Client asserts:
940940
/// - received status code is 12 (UNIMPLEMENTED)
941941
struct UnimplementedMethod: InteroperabilityTest {
942-
func run(client: GRPCClient) async throws {
942+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
943943
let testServiceClient = Grpc_Testing_TestService.Client(wrapping: client)
944944
try await testServiceClient.unimplementedCall(
945945
request: ClientRequest(message: Grpc_Testing_Empty())
@@ -971,7 +971,7 @@ struct UnimplementedMethod: InteroperabilityTest {
971971
/// Client asserts:
972972
/// - received status code is 12 (UNIMPLEMENTED)
973973
struct UnimplementedService: InteroperabilityTest {
974-
func run(client: GRPCClient) async throws {
974+
func run<Transport: ClientTransport>(client: GRPCClient<Transport>) async throws {
975975
let unimplementedServiceClient = Grpc_Testing_UnimplementedService.Client(wrapping: client)
976976
try await unimplementedServiceClient.unimplementedCall(
977977
request: ClientRequest(message: Grpc_Testing_Empty())

Sources/GRPCReflectionService/Generated/reflection.grpc.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ extension Grpc_Reflection_V1_ServerReflection {
155155

156156
// Default implementation of 'registerMethods(with:)'.
157157
extension Grpc_Reflection_V1_ServerReflection.StreamingServiceProtocol {
158-
package func registerMethods(with router: inout GRPCCore.RPCRouter) {
158+
package func registerMethods<Transport>(with router: inout GRPCCore.RPCRouter<Transport>) where Transport: GRPCCore.ServerTransport {
159159
router.registerHandler(
160160
forMethod: Grpc_Reflection_V1_ServerReflection.Method.ServerReflectionInfo.descriptor,
161161
deserializer: GRPCProtobuf.ProtobufDeserializer<Grpc_Reflection_V1_ServerReflectionRequest>(),
@@ -232,14 +232,14 @@ extension Grpc_Reflection_V1_ServerReflection {
232232
/// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps
233233
/// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived
234234
/// means of communication with the remote peer.
235-
package struct Client: ClientProtocol {
236-
private let client: GRPCCore.GRPCClient
235+
package struct Client<Transport>: ClientProtocol where Transport: GRPCCore.ClientTransport {
236+
private let client: GRPCCore.GRPCClient<Transport>
237237

238238
/// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
239239
///
240240
/// - Parameters:
241241
/// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
242-
package init(wrapping client: GRPCCore.GRPCClient) {
242+
package init(wrapping client: GRPCCore.GRPCClient<Transport>) {
243243
self.client = client
244244
}
245245

Sources/GRPCReflectionService/Service/ReflectionService.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public struct ReflectionService: Sendable {
6868
}
6969

7070
extension ReflectionService: RegistrableRPCService {
71-
public func registerMethods(with router: inout RPCRouter) {
71+
public func registerMethods<Transport>(
72+
with router: inout RPCRouter<Transport>
73+
) where Transport: ServerTransport {
7274
self.service.registerMethods(with: &router)
7375
}
7476
}

0 commit comments

Comments
 (0)