Skip to content

Commit 8fa87bf

Browse files
committed
streaming -> isStreaming
1 parent b503984 commit 8fa87bf

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

Diff for: Sources/GRPCCodeGen/Internal/Namer.swift

+23-8
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,40 @@ package struct Namer: Sendable, Hashable {
4747
return self.grpcCore + "." + type
4848
}
4949

50-
func serverRequest(forType type: String?, streaming: Bool) -> ExistingTypeDescription {
51-
return self.requestResponse(for: type, isRequest: true, isStreaming: streaming, isClient: false)
50+
func serverRequest(forType type: String?, isStreaming: Bool) -> ExistingTypeDescription {
51+
return self.requestResponse(
52+
for: type,
53+
isRequest: true,
54+
isStreaming: isStreaming,
55+
isClient: false
56+
)
5257
}
5358

54-
func serverResponse(forType type: String?, streaming: Bool) -> ExistingTypeDescription {
59+
func serverResponse(forType type: String?, isStreaming: Bool) -> ExistingTypeDescription {
5560
return self.requestResponse(
5661
for: type,
5762
isRequest: false,
58-
isStreaming: streaming,
63+
isStreaming: isStreaming,
5964
isClient: false
6065
)
6166
}
6267

63-
func clientRequest(forType type: String?, streaming: Bool) -> ExistingTypeDescription {
64-
return self.requestResponse(for: type, isRequest: true, isStreaming: streaming, isClient: true)
68+
func clientRequest(forType type: String?, isStreaming: Bool) -> ExistingTypeDescription {
69+
return self.requestResponse(
70+
for: type,
71+
isRequest: true,
72+
isStreaming: isStreaming,
73+
isClient: true
74+
)
6575
}
6676

67-
func clientResponse(forType type: String?, streaming: Bool) -> ExistingTypeDescription {
68-
return self.requestResponse(for: type, isRequest: false, isStreaming: streaming, isClient: true)
77+
func clientResponse(forType type: String?, isStreaming: Bool) -> ExistingTypeDescription {
78+
return self.requestResponse(
79+
for: type,
80+
isRequest: false,
81+
isStreaming: isStreaming,
82+
isClient: true
83+
)
6984
}
7085

7186
var serverContext: ExistingTypeDescription {

Diff for: Sources/GRPCCodeGen/Internal/StructuredSwift+Client.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension FunctionSignatureDescription {
6262
signature.parameters.append(
6363
ParameterDescription(
6464
label: "request",
65-
type: namer.clientRequest(forType: input, streaming: streamingInput)
65+
type: namer.clientRequest(forType: input, isStreaming: streamingInput)
6666
)
6767
)
6868

@@ -99,7 +99,7 @@ extension FunctionSignatureDescription {
9999
ClosureSignatureDescription(
100100
parameters: [
101101
ParameterDescription(
102-
type: namer.clientResponse(forType: output, streaming: streamingOutput)
102+
type: namer.clientResponse(forType: output, isStreaming: streamingOutput)
103103
)
104104
],
105105
keywords: [.async, .throws],
@@ -358,7 +358,7 @@ extension FunctionSignatureDescription {
358358
ClosureSignatureDescription(
359359
parameters: [
360360
ParameterDescription(
361-
type: namer.clientResponse(forType: output, streaming: streamingOutput)
361+
type: namer.clientResponse(forType: output, isStreaming: streamingOutput)
362362
)
363363
],
364364
keywords: [.async, .throws],
@@ -423,7 +423,7 @@ extension [CodeBlock] {
423423
left: .identifierPattern("request"),
424424
right: .functionCall(
425425
calledExpression: .identifierType(
426-
namer.clientRequest(forType: input, streaming: streamingInput)
426+
namer.clientRequest(forType: input, isStreaming: streamingInput)
427427
),
428428
arguments: arguments(streaming: streamingInput)
429429
)
@@ -579,7 +579,7 @@ extension FunctionDescription {
579579
parameters: [
580580
ParameterDescription(
581581
label: "request",
582-
type: namer.clientRequest(forType: input, streaming: streamingInput)
582+
type: namer.clientRequest(forType: input, isStreaming: streamingInput)
583583
),
584584
ParameterDescription(
585585
label: "serializer",
@@ -603,7 +603,7 @@ extension FunctionDescription {
603603
ClosureSignatureDescription(
604604
parameters: [
605605
ParameterDescription(
606-
type: namer.clientResponse(forType: output, streaming: streamingOutput)
606+
type: namer.clientResponse(forType: output, isStreaming: streamingOutput)
607607
)
608608
],
609609
keywords: [.async, .throws],

Diff for: Sources/GRPCCodeGen/Internal/StructuredSwift+Server.swift

+7-5
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ extension FunctionSignatureDescription {
3636
parameters: [
3737
ParameterDescription(
3838
label: "request",
39-
type: namer.serverRequest(forType: input, streaming: streamingInput)
39+
type: namer.serverRequest(forType: input, isStreaming: streamingInput)
4040
),
4141
ParameterDescription(label: "context", type: namer.serverContext),
4242
],
4343
keywords: [.async, .throws],
44-
returnType: .identifierType(namer.serverResponse(forType: output, streaming: streamingOutput))
44+
returnType: .identifierType(
45+
namer.serverResponse(forType: output, isStreaming: streamingOutput)
46+
)
4547
)
4648
}
4749
}
@@ -396,7 +398,7 @@ extension FunctionDescription {
396398
? .identifierPattern("request")
397399
: .functionCall(
398400
calledExpression: .identifierType(
399-
namer.serverRequest(forType: nil, streaming: false)
401+
namer.serverRequest(forType: nil, isStreaming: false)
400402
),
401403
arguments: [
402404
FunctionArgumentDescription(
@@ -432,7 +434,7 @@ extension FunctionDescription {
432434
expression: streamingOutput
433435
? .identifierPattern("response")
434436
: .functionCall(
435-
calledExpression: .identifierType(namer.serverResponse(forType: nil, streaming: true)),
437+
calledExpression: .identifierType(namer.serverResponse(forType: nil, isStreaming: true)),
436438
arguments: [
437439
FunctionArgumentDescription(
438440
label: "single",
@@ -750,7 +752,7 @@ extension FunctionDescription {
750752
.functionCall(
751753
calledExpression: .return(
752754
.identifierType(
753-
namer.serverResponse(forType: output, streaming: streamingOutput)
755+
namer.serverResponse(forType: output, isStreaming: streamingOutput)
754756
)
755757
),
756758
arguments: streamingOutput ? makeStreamingOutputArguments() : makeUnaryOutputArguments()

0 commit comments

Comments
 (0)