ReflectionGrpc.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: grpc/reflection/v1alpha/reflection.proto
  3. // Original file comments:
  4. // Copyright 2016, Google Inc.
  5. // All rights reserved.
  6. //
  7. // Redistribution and use in source and binary forms, with or without
  8. // modification, are permitted provided that the following conditions are
  9. // met:
  10. //
  11. // * Redistributions of source code must retain the above copyright
  12. // notice, this list of conditions and the following disclaimer.
  13. // * Redistributions in binary form must reproduce the above
  14. // copyright notice, this list of conditions and the following disclaimer
  15. // in the documentation and/or other materials provided with the
  16. // distribution.
  17. // * Neither the name of Google Inc. nor the names of its
  18. // contributors may be used to endorse or promote products derived from
  19. // this software without specific prior written permission.
  20. //
  21. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. //
  33. // Service exported by server reflection
  34. //
  35. #region Designer generated code
  36. using System;
  37. using System.Threading;
  38. using System.Threading.Tasks;
  39. using Grpc.Core;
  40. namespace Grpc.Reflection.V1Alpha {
  41. public static partial class ServerReflection
  42. {
  43. static readonly string __ServiceName = "grpc.reflection.v1alpha.ServerReflection";
  44. static readonly Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> __Marshaller_ServerReflectionRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser.ParseFrom);
  45. static readonly Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Marshaller_ServerReflectionResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser.ParseFrom);
  46. static readonly Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Method_ServerReflectionInfo = new Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse>(
  47. MethodType.DuplexStreaming,
  48. __ServiceName,
  49. "ServerReflectionInfo",
  50. __Marshaller_ServerReflectionRequest,
  51. __Marshaller_ServerReflectionResponse);
  52. /// <summary>Service descriptor</summary>
  53. public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
  54. {
  55. get { return global::Grpc.Reflection.V1Alpha.ReflectionReflection.Descriptor.Services[0]; }
  56. }
  57. /// <summary>Base class for server-side implementations of ServerReflection</summary>
  58. public abstract partial class ServerReflectionBase
  59. {
  60. /// <summary>
  61. /// The reflection service is structured as a bidirectional stream, ensuring
  62. /// all related requests go to a single server.
  63. /// </summary>
  64. /// <param name="requestStream">Used for reading requests from the client.</param>
  65. /// <param name="responseStream">Used for sending responses back to the client.</param>
  66. /// <param name="context">The context of the server-side call handler being invoked.</param>
  67. /// <returns>A task indicating completion of the handler.</returns>
  68. public virtual global::System.Threading.Tasks.Task ServerReflectionInfo(IAsyncStreamReader<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> requestStream, IServerStreamWriter<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> responseStream, ServerCallContext context)
  69. {
  70. throw new RpcException(new Status(StatusCode.Unimplemented, ""));
  71. }
  72. }
  73. /// <summary>Client for ServerReflection</summary>
  74. public partial class ServerReflectionClient : ClientBase<ServerReflectionClient>
  75. {
  76. /// <summary>Creates a new client for ServerReflection</summary>
  77. /// <param name="channel">The channel to use to make remote calls.</param>
  78. public ServerReflectionClient(Channel channel) : base(channel)
  79. {
  80. }
  81. /// <summary>Creates a new client for ServerReflection that uses a custom <c>CallInvoker</c>.</summary>
  82. /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
  83. public ServerReflectionClient(CallInvoker callInvoker) : base(callInvoker)
  84. {
  85. }
  86. /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
  87. protected ServerReflectionClient() : base()
  88. {
  89. }
  90. /// <summary>Protected constructor to allow creation of configured clients.</summary>
  91. /// <param name="configuration">The client configuration.</param>
  92. protected ServerReflectionClient(ClientBaseConfiguration configuration) : base(configuration)
  93. {
  94. }
  95. /// <summary>
  96. /// The reflection service is structured as a bidirectional stream, ensuring
  97. /// all related requests go to a single server.
  98. /// </summary>
  99. /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
  100. /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
  101. /// <param name="cancellationToken">An optional token for canceling the call.</param>
  102. /// <returns>The call object.</returns>
  103. public virtual AsyncDuplexStreamingCall<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> ServerReflectionInfo(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
  104. {
  105. return ServerReflectionInfo(new CallOptions(headers, deadline, cancellationToken));
  106. }
  107. /// <summary>
  108. /// The reflection service is structured as a bidirectional stream, ensuring
  109. /// all related requests go to a single server.
  110. /// </summary>
  111. /// <param name="options">The options for the call.</param>
  112. /// <returns>The call object.</returns>
  113. public virtual AsyncDuplexStreamingCall<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> ServerReflectionInfo(CallOptions options)
  114. {
  115. return CallInvoker.AsyncDuplexStreamingCall(__Method_ServerReflectionInfo, null, options);
  116. }
  117. /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
  118. protected override ServerReflectionClient NewInstance(ClientBaseConfiguration configuration)
  119. {
  120. return new ServerReflectionClient(configuration);
  121. }
  122. }
  123. /// <summary>Creates service definition that can be registered with a server</summary>
  124. /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
  125. public static ServerServiceDefinition BindService(ServerReflectionBase serviceImpl)
  126. {
  127. return ServerServiceDefinition.CreateBuilder()
  128. .AddMethod(__Method_ServerReflectionInfo, serviceImpl.ServerReflectionInfo).Build();
  129. }
  130. }
  131. }
  132. #endregion