-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated reflection service code #1659
Conversation
Motivation: In order to develop the Reflection Service, the specific proto file should be included in the module and the service code generated from it. Modifications: Created the module for the Reflection Service, added the proto file, updated the Package.swift to include the module, updated the Makefile to inlude targets for generating the server code, created the ReflectionProvider. Result: The Reflection Service can now be implemented.
Package.swift
Outdated
@@ -89,6 +89,7 @@ extension Target.Dependency { | |||
static let interopTestModels: Self = .target(name: "GRPCInteroperabilityTestModels") | |||
static let interopTestImplementation: Self = | |||
.target(name: "GRPCInteroperabilityTestsImplementation") | |||
static let reflectionService: Self = .target(name: "ReflectionService") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static let reflectionService: Self = .target(name: "ReflectionService") | |
static let reflectionService: Self = .target(name: "GRPCReflectionService") |
Package.swift
Outdated
@@ -428,6 +429,19 @@ extension Target { | |||
"README.md", | |||
] | |||
) | |||
|
|||
static let reflectionService: Target = .target( | |||
name: "ReflectionService", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: "ReflectionService", | |
name: "GRPCReflectionService", |
@@ -0,0 +1,141 @@ | |||
// Copyright 2023 The gRPC Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This license header should be unchanged from https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
@@ -0,0 +1,29 @@ | |||
/* | |||
* Copyright 2019, gRPC Authors All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 2023
import GRPC | ||
|
||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) | ||
final class ReflectionProvider: Reflection_ServerReflectionAsyncProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final class ReflectionProvider: Reflection_ServerReflectionAsyncProvider { | |
final class ReflectionService: Reflection_ServerReflectionAsyncProvider { |
requestStream: GRPC.GRPCAsyncRequestStream<Reflection_ServerReflectionRequest>, | ||
responseStream: GRPC.GRPCAsyncResponseStreamWriter<Reflection_ServerReflectionResponse>, | ||
context: GRPC.GRPCAsyncServerCallContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requestStream: GRPC.GRPCAsyncRequestStream<Reflection_ServerReflectionRequest>, | |
responseStream: GRPC.GRPCAsyncResponseStreamWriter<Reflection_ServerReflectionResponse>, | |
context: GRPC.GRPCAsyncServerCallContext | |
requestStream: GRPCAsyncRequestStream<Reflection_ServerReflectionRequest>, | |
responseStream: GRPCAsyncResponseStreamWriter<Reflection_ServerReflectionResponse>, | |
context: GRPCAsyncServerCallContext |
Motivation:
In order to develop the Reflection Service, the specific proto file should be included in the module and the service code generated from it.
Modifications:
Created the module for the Reflection Service, added the proto file, updated the Package.swift to include the module, updated the Makefile to inlude targets for generating the server code, created the ReflectionProvider.
Result:
The Reflection Service can now be implemented.