Skip to content

Commit f246039

Browse files
committed
Update examples
Motivation: In #2072 the code gen was changed to add an underscore to the generated names. This wasn't picked up in CI because the examples depend on "main" at the moment. Modifications: - Update examples Result: CI passes
1 parent c8d5500 commit f246039

File tree

14 files changed

+38
-38
lines changed

14 files changed

+38
-38
lines changed

Examples/echo/Sources/Generated/echo.grpc.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ internal enum Echo_Echo {
6767
]
6868
}
6969
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
70-
internal typealias StreamingServiceProtocol = Echo_EchoStreamingServiceProtocol
70+
internal typealias StreamingServiceProtocol = Echo_Echo_StreamingServiceProtocol
7171
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
72-
internal typealias ServiceProtocol = Echo_EchoServiceProtocol
72+
internal typealias ServiceProtocol = Echo_Echo_ServiceProtocol
7373
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
74-
internal typealias ClientProtocol = Echo_EchoClientProtocol
74+
internal typealias ClientProtocol = Echo_Echo_ClientProtocol
7575
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
76-
internal typealias Client = Echo_EchoClient
76+
internal typealias Client = Echo_Echo_Client
7777
}
7878

7979
extension GRPCCore.ServiceDescriptor {
@@ -84,7 +84,7 @@ extension GRPCCore.ServiceDescriptor {
8484
}
8585

8686
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
87-
internal protocol Echo_EchoStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
87+
internal protocol Echo_Echo_StreamingServiceProtocol: GRPCCore.RegistrableRPCService {
8888
/// Immediately returns an echo of a request.
8989
func get(
9090
request: GRPCCore.ServerRequest.Stream<Echo_EchoRequest>,
@@ -163,7 +163,7 @@ extension Echo_Echo.StreamingServiceProtocol {
163163
}
164164

165165
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
166-
internal protocol Echo_EchoServiceProtocol: Echo_Echo.StreamingServiceProtocol {
166+
internal protocol Echo_Echo_ServiceProtocol: Echo_Echo.StreamingServiceProtocol {
167167
/// Immediately returns an echo of a request.
168168
func get(
169169
request: GRPCCore.ServerRequest.Single<Echo_EchoRequest>,
@@ -189,7 +189,7 @@ internal protocol Echo_EchoServiceProtocol: Echo_Echo.StreamingServiceProtocol {
189189
) async throws -> GRPCCore.ServerResponse.Stream<Echo_EchoResponse>
190190
}
191191

192-
/// Partial conformance to `Echo_EchoStreamingServiceProtocol`.
192+
/// Partial conformance to `Echo_Echo_StreamingServiceProtocol`.
193193
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
194194
extension Echo_Echo.ServiceProtocol {
195195
internal func get(
@@ -227,7 +227,7 @@ extension Echo_Echo.ServiceProtocol {
227227
}
228228

229229
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
230-
internal protocol Echo_EchoClientProtocol: Sendable {
230+
internal protocol Echo_Echo_ClientProtocol: Sendable {
231231
/// Immediately returns an echo of a request.
232232
func get<R>(
233233
request: GRPCCore.ClientRequest.Single<Echo_EchoRequest>,
@@ -408,7 +408,7 @@ extension Echo_Echo.ClientProtocol {
408408
}
409409

410410
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
411-
internal struct Echo_EchoClient: Echo_Echo.ClientProtocol {
411+
internal struct Echo_Echo_Client: Echo_Echo.ClientProtocol {
412412
private let client: GRPCCore.GRPCClient
413413

414414
internal init(wrapping client: GRPCCore.GRPCClient) {

Examples/echo/Sources/Subcommands/Collect.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct Collect: AsyncParsableCommand {
3939
try await client.run()
4040
}
4141

42-
let echo = Echo_EchoClient(wrapping: client)
42+
let echo = Echo_Echo_Client(wrapping: client)
4343

4444
for _ in 0 ..< self.arguments.repetitions {
4545
let message = try await echo.collect { writer in

Examples/echo/Sources/Subcommands/Expand.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct Expand: AsyncParsableCommand {
3939
try await client.run()
4040
}
4141

42-
let echo = Echo_EchoClient(wrapping: client)
42+
let echo = Echo_Echo_Client(wrapping: client)
4343

4444
for _ in 0 ..< self.arguments.repetitions {
4545
let message = Echo_EchoRequest.with { $0.text = self.arguments.message }

Examples/echo/Sources/Subcommands/Get.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct Get: AsyncParsableCommand {
3737
try await client.run()
3838
}
3939

40-
let echo = Echo_EchoClient(wrapping: client)
40+
let echo = Echo_Echo_Client(wrapping: client)
4141

4242
for _ in 0 ..< self.arguments.repetitions {
4343
let message = Echo_EchoRequest.with { $0.text = self.arguments.message }

Examples/echo/Sources/Subcommands/Serve.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct Serve: AsyncParsableCommand {
4343
}
4444

4545
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
46-
struct EchoService: Echo_EchoServiceProtocol {
46+
struct EchoService: Echo_Echo_ServiceProtocol {
4747
func get(
4848
request: ServerRequest.Single<Echo_EchoRequest>,
4949
context: ServerContext

Examples/echo/Sources/Subcommands/Update.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct Update: AsyncParsableCommand {
3939
try await client.run()
4040
}
4141

42-
let echo = Echo_EchoClient(wrapping: client)
42+
let echo = Echo_Echo_Client(wrapping: client)
4343

4444
for _ in 0 ..< self.arguments.repetitions {
4545
try await echo.update { writer in

Examples/hello-world/Sources/Generated/helloworld.grpc.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ internal enum Helloworld_Greeter {
4040
]
4141
}
4242
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
43-
internal typealias StreamingServiceProtocol = Helloworld_GreeterStreamingServiceProtocol
43+
internal typealias StreamingServiceProtocol = Helloworld_Greeter_StreamingServiceProtocol
4444
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
45-
internal typealias ServiceProtocol = Helloworld_GreeterServiceProtocol
45+
internal typealias ServiceProtocol = Helloworld_Greeter_ServiceProtocol
4646
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
47-
internal typealias ClientProtocol = Helloworld_GreeterClientProtocol
47+
internal typealias ClientProtocol = Helloworld_Greeter_ClientProtocol
4848
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
49-
internal typealias Client = Helloworld_GreeterClient
49+
internal typealias Client = Helloworld_Greeter_Client
5050
}
5151

5252
extension GRPCCore.ServiceDescriptor {
@@ -58,7 +58,7 @@ extension GRPCCore.ServiceDescriptor {
5858

5959
/// The greeting service definition.
6060
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
61-
internal protocol Helloworld_GreeterStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
61+
internal protocol Helloworld_Greeter_StreamingServiceProtocol: GRPCCore.RegistrableRPCService {
6262
/// Sends a greeting
6363
func sayHello(
6464
request: GRPCCore.ServerRequest.Stream<Helloworld_HelloRequest>,
@@ -87,15 +87,15 @@ extension Helloworld_Greeter.StreamingServiceProtocol {
8787

8888
/// The greeting service definition.
8989
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
90-
internal protocol Helloworld_GreeterServiceProtocol: Helloworld_Greeter.StreamingServiceProtocol {
90+
internal protocol Helloworld_Greeter_ServiceProtocol: Helloworld_Greeter.StreamingServiceProtocol {
9191
/// Sends a greeting
9292
func sayHello(
9393
request: GRPCCore.ServerRequest.Single<Helloworld_HelloRequest>,
9494
context: GRPCCore.ServerContext
9595
) async throws -> GRPCCore.ServerResponse.Single<Helloworld_HelloReply>
9696
}
9797

98-
/// Partial conformance to `Helloworld_GreeterStreamingServiceProtocol`.
98+
/// Partial conformance to `Helloworld_Greeter_StreamingServiceProtocol`.
9999
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
100100
extension Helloworld_Greeter.ServiceProtocol {
101101
internal func sayHello(
@@ -112,7 +112,7 @@ extension Helloworld_Greeter.ServiceProtocol {
112112

113113
/// The greeting service definition.
114114
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
115-
internal protocol Helloworld_GreeterClientProtocol: Sendable {
115+
internal protocol Helloworld_Greeter_ClientProtocol: Sendable {
116116
/// Sends a greeting
117117
func sayHello<R>(
118118
request: GRPCCore.ClientRequest.Single<Helloworld_HelloRequest>,
@@ -167,7 +167,7 @@ extension Helloworld_Greeter.ClientProtocol {
167167

168168
/// The greeting service definition.
169169
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
170-
internal struct Helloworld_GreeterClient: Helloworld_Greeter.ClientProtocol {
170+
internal struct Helloworld_Greeter_Client: Helloworld_Greeter.ClientProtocol {
171171
private let client: GRPCCore.GRPCClient
172172

173173
internal init(wrapping client: GRPCCore.GRPCClient) {

Examples/hello-world/Sources/Subcommands/Greet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct Greet: AsyncParsableCommand {
4444
client.beginGracefulShutdown()
4545
}
4646

47-
let greeter = Helloworld_GreeterClient(wrapping: client)
47+
let greeter = Helloworld_Greeter_Client(wrapping: client)
4848
let reply = try await greeter.sayHello(.with { $0.name = self.name })
4949
print(reply.message)
5050
}

Examples/hello-world/Sources/Subcommands/Serve.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct Serve: AsyncParsableCommand {
4242
}
4343
}
4444

45-
struct Greeter: Helloworld_GreeterServiceProtocol {
45+
struct Greeter: Helloworld_Greeter_ServiceProtocol {
4646
func sayHello(
4747
request: ServerRequest.Single<Helloworld_HelloRequest>,
4848
context: ServerContext

Examples/route-guide/Sources/Generated/route_guide.grpc.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ internal enum Routeguide_RouteGuide {
6767
]
6868
}
6969
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
70-
internal typealias StreamingServiceProtocol = Routeguide_RouteGuideStreamingServiceProtocol
70+
internal typealias StreamingServiceProtocol = Routeguide_RouteGuide_StreamingServiceProtocol
7171
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
72-
internal typealias ServiceProtocol = Routeguide_RouteGuideServiceProtocol
72+
internal typealias ServiceProtocol = Routeguide_RouteGuide_ServiceProtocol
7373
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
74-
internal typealias ClientProtocol = Routeguide_RouteGuideClientProtocol
74+
internal typealias ClientProtocol = Routeguide_RouteGuide_ClientProtocol
7575
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
76-
internal typealias Client = Routeguide_RouteGuideClient
76+
internal typealias Client = Routeguide_RouteGuide_Client
7777
}
7878

7979
extension GRPCCore.ServiceDescriptor {
@@ -85,7 +85,7 @@ extension GRPCCore.ServiceDescriptor {
8585

8686
/// Interface exported by the server.
8787
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
88-
internal protocol Routeguide_RouteGuideStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
88+
internal protocol Routeguide_RouteGuide_StreamingServiceProtocol: GRPCCore.RegistrableRPCService {
8989
/// A simple RPC.
9090
///
9191
/// Obtains the feature at a given position.
@@ -181,7 +181,7 @@ extension Routeguide_RouteGuide.StreamingServiceProtocol {
181181

182182
/// Interface exported by the server.
183183
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
184-
internal protocol Routeguide_RouteGuideServiceProtocol: Routeguide_RouteGuide.StreamingServiceProtocol {
184+
internal protocol Routeguide_RouteGuide_ServiceProtocol: Routeguide_RouteGuide.StreamingServiceProtocol {
185185
/// A simple RPC.
186186
///
187187
/// Obtains the feature at a given position.
@@ -223,7 +223,7 @@ internal protocol Routeguide_RouteGuideServiceProtocol: Routeguide_RouteGuide.St
223223
) async throws -> GRPCCore.ServerResponse.Stream<Routeguide_RouteNote>
224224
}
225225

226-
/// Partial conformance to `Routeguide_RouteGuideStreamingServiceProtocol`.
226+
/// Partial conformance to `Routeguide_RouteGuide_StreamingServiceProtocol`.
227227
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
228228
extension Routeguide_RouteGuide.ServiceProtocol {
229229
internal func getFeature(
@@ -262,7 +262,7 @@ extension Routeguide_RouteGuide.ServiceProtocol {
262262

263263
/// Interface exported by the server.
264264
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
265-
internal protocol Routeguide_RouteGuideClientProtocol: Sendable {
265+
internal protocol Routeguide_RouteGuide_ClientProtocol: Sendable {
266266
/// A simple RPC.
267267
///
268268
/// Obtains the feature at a given position.
@@ -476,7 +476,7 @@ extension Routeguide_RouteGuide.ClientProtocol {
476476

477477
/// Interface exported by the server.
478478
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
479-
internal struct Routeguide_RouteGuideClient: Routeguide_RouteGuide.ClientProtocol {
479+
internal struct Routeguide_RouteGuide_Client: Routeguide_RouteGuide.ClientProtocol {
480480
private let client: GRPCCore.GRPCClient
481481

482482
internal init(wrapping client: GRPCCore.GRPCClient) {

0 commit comments

Comments
 (0)