reflection-v1.grpc.swift 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // DO NOT EDIT.
  3. // swift-format-ignore-file
  4. //
  5. // Generated by the protocol buffer compiler.
  6. // Source: reflection.proto
  7. //
  8. import GRPC
  9. import NIO
  10. import NIOConcurrencyHelpers
  11. import SwiftProtobuf
  12. /// To build a server, implement a class that conforms to this protocol.
  13. internal protocol Grpc_Reflection_V1_ServerReflectionProvider: CallHandlerProvider {
  14. var interceptors: Grpc_Reflection_V1_ServerReflectionServerInterceptorFactoryProtocol? { get }
  15. /// The reflection service is structured as a bidirectional stream, ensuring
  16. /// all related requests go to a single server.
  17. func serverReflectionInfo(context: StreamingResponseCallContext<Grpc_Reflection_V1_ServerReflectionResponse>) -> EventLoopFuture<(StreamEvent<Grpc_Reflection_V1_ServerReflectionRequest>) -> Void>
  18. }
  19. extension Grpc_Reflection_V1_ServerReflectionProvider {
  20. internal var serviceName: Substring {
  21. return Grpc_Reflection_V1_ServerReflectionServerMetadata.serviceDescriptor.fullName[...]
  22. }
  23. /// Determines, calls and returns the appropriate request handler, depending on the request's method.
  24. /// Returns nil for methods not handled by this service.
  25. internal func handle(
  26. method name: Substring,
  27. context: CallHandlerContext
  28. ) -> GRPCServerHandlerProtocol? {
  29. switch name {
  30. case "ServerReflectionInfo":
  31. return BidirectionalStreamingServerHandler(
  32. context: context,
  33. requestDeserializer: ProtobufDeserializer<Grpc_Reflection_V1_ServerReflectionRequest>(),
  34. responseSerializer: ProtobufSerializer<Grpc_Reflection_V1_ServerReflectionResponse>(),
  35. interceptors: self.interceptors?.makeServerReflectionInfoInterceptors() ?? [],
  36. observerFactory: self.serverReflectionInfo(context:)
  37. )
  38. default:
  39. return nil
  40. }
  41. }
  42. }
  43. /// To implement a server, implement an object which conforms to this protocol.
  44. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
  45. internal protocol Grpc_Reflection_V1_ServerReflectionAsyncProvider: CallHandlerProvider, Sendable {
  46. static var serviceDescriptor: GRPCServiceDescriptor { get }
  47. var interceptors: Grpc_Reflection_V1_ServerReflectionServerInterceptorFactoryProtocol? { get }
  48. /// The reflection service is structured as a bidirectional stream, ensuring
  49. /// all related requests go to a single server.
  50. func serverReflectionInfo(
  51. requestStream: GRPCAsyncRequestStream<Grpc_Reflection_V1_ServerReflectionRequest>,
  52. responseStream: GRPCAsyncResponseStreamWriter<Grpc_Reflection_V1_ServerReflectionResponse>,
  53. context: GRPCAsyncServerCallContext
  54. ) async throws
  55. }
  56. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
  57. extension Grpc_Reflection_V1_ServerReflectionAsyncProvider {
  58. internal static var serviceDescriptor: GRPCServiceDescriptor {
  59. return Grpc_Reflection_V1_ServerReflectionServerMetadata.serviceDescriptor
  60. }
  61. internal var serviceName: Substring {
  62. return Grpc_Reflection_V1_ServerReflectionServerMetadata.serviceDescriptor.fullName[...]
  63. }
  64. internal var interceptors: Grpc_Reflection_V1_ServerReflectionServerInterceptorFactoryProtocol? {
  65. return nil
  66. }
  67. internal func handle(
  68. method name: Substring,
  69. context: CallHandlerContext
  70. ) -> GRPCServerHandlerProtocol? {
  71. switch name {
  72. case "ServerReflectionInfo":
  73. return GRPCAsyncServerHandler(
  74. context: context,
  75. requestDeserializer: ProtobufDeserializer<Grpc_Reflection_V1_ServerReflectionRequest>(),
  76. responseSerializer: ProtobufSerializer<Grpc_Reflection_V1_ServerReflectionResponse>(),
  77. interceptors: self.interceptors?.makeServerReflectionInfoInterceptors() ?? [],
  78. wrapping: { try await self.serverReflectionInfo(requestStream: $0, responseStream: $1, context: $2) }
  79. )
  80. default:
  81. return nil
  82. }
  83. }
  84. }
  85. internal protocol Grpc_Reflection_V1_ServerReflectionServerInterceptorFactoryProtocol: Sendable {
  86. /// - Returns: Interceptors to use when handling 'serverReflectionInfo'.
  87. /// Defaults to calling `self.makeInterceptors()`.
  88. func makeServerReflectionInfoInterceptors() -> [ServerInterceptor<Grpc_Reflection_V1_ServerReflectionRequest, Grpc_Reflection_V1_ServerReflectionResponse>]
  89. }
  90. internal enum Grpc_Reflection_V1_ServerReflectionServerMetadata {
  91. internal static let serviceDescriptor = GRPCServiceDescriptor(
  92. name: "ServerReflection",
  93. fullName: "grpc.reflection.v1.ServerReflection",
  94. methods: [
  95. Grpc_Reflection_V1_ServerReflectionServerMetadata.Methods.serverReflectionInfo,
  96. ]
  97. )
  98. internal enum Methods {
  99. internal static let serverReflectionInfo = GRPCMethodDescriptor(
  100. name: "ServerReflectionInfo",
  101. path: "/grpc.reflection.v1.ServerReflection/ServerReflectionInfo",
  102. type: GRPCCallType.bidirectionalStreaming
  103. )
  104. }
  105. }