File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Examples/hello-world/Sources/Subcommands Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ struct Greet: AsyncParsableCommand {
33
33
let client = GRPCClient (
34
34
transport: try . http2NIOPosix(
35
35
target: . ipv4( host: " 127.0.0.1 " , port: self . port) ,
36
- config : . defaults ( transportSecurity: . plaintext)
36
+ transportSecurity: . plaintext
37
37
)
38
38
)
39
39
@@ -45,7 +45,7 @@ struct Greet: AsyncParsableCommand {
45
45
client. beginGracefulShutdown ( )
46
46
}
47
47
48
- let greeter = Helloworld_Greeter_Client ( wrapping: client)
48
+ let greeter = Helloworld_Greeter . Client ( wrapping: client)
49
49
let reply = try await greeter. sayHello ( . with { $0. name = self . name } )
50
50
print ( reply. message)
51
51
}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ struct Serve: AsyncParsableCommand {
29
29
let server = GRPCServer (
30
30
transport: . http2NIOPosix(
31
31
address: . ipv4( host: " 127.0.0.1 " , port: self . port) ,
32
- config : . defaults ( transportSecurity: . plaintext)
32
+ transportSecurity: . plaintext
33
33
) ,
34
34
services: [ Greeter ( ) ]
35
35
)
@@ -43,14 +43,14 @@ struct Serve: AsyncParsableCommand {
43
43
}
44
44
}
45
45
46
- struct Greeter : Helloworld_Greeter_ServiceProtocol {
46
+ struct Greeter : Helloworld_Greeter . SimpleServiceProtocol {
47
47
func sayHello(
48
- request: ServerRequest < Helloworld_HelloRequest > ,
48
+ request: Helloworld_HelloRequest ,
49
49
context: ServerContext
50
- ) async throws -> ServerResponse < Helloworld_HelloReply > {
50
+ ) async throws -> Helloworld_HelloReply {
51
51
var reply = Helloworld_HelloReply ( )
52
- let recipient = request. message . name. isEmpty ? " stranger " : request. message . name
52
+ let recipient = request. name. isEmpty ? " stranger " : request. name
53
53
reply. message = " Hello, \( recipient) "
54
- return ServerResponse ( message : reply)
54
+ return reply
55
55
}
56
56
}
You can’t perform that action at this time.
0 commit comments