RouteGuideStub.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. // GENERATED CODE -- DO NOT EDIT!
  3. // Original file comments:
  4. // Copyright 2015 gRPC authors.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. //
  18. namespace Routeguide;
  19. /**
  20. * Interface exported by the server.
  21. */
  22. class RouteGuideStub {
  23. /**
  24. * A simple RPC.
  25. *
  26. * Obtains the feature at a given position.
  27. *
  28. * A feature with an empty name is returned if there's no feature at the given
  29. * position.
  30. * @param \Routeguide\Point $request client request
  31. * @param \Grpc\ServerContext $context server request context
  32. * @return \Routeguide\Feature for response data, null if if error occured
  33. * initial metadata (if any) and status (if not ok) should be set to $context
  34. */
  35. public function GetFeature(
  36. \Routeguide\Point $request,
  37. \Grpc\ServerContext $context
  38. ): ?\Routeguide\Feature {
  39. $context->setStatus(\Grpc\Status::unimplemented());
  40. return null;
  41. }
  42. /**
  43. * A server-to-client streaming RPC.
  44. *
  45. * Obtains the Features available within the given Rectangle. Results are
  46. * streamed rather than returned at once (e.g. in a response message with a
  47. * repeated field), as the rectangle may cover a large area and contain a
  48. * huge number of features.
  49. * @param \Routeguide\Rectangle $request client request
  50. * @param \Grpc\ServerCallWriter $writer write response data of \Routeguide\Feature
  51. * @param \Grpc\ServerContext $context server request context
  52. * @return void
  53. */
  54. public function ListFeatures(
  55. \Routeguide\Rectangle $request,
  56. \Grpc\ServerCallWriter $writer,
  57. \Grpc\ServerContext $context
  58. ): void {
  59. $context->setStatus(\Grpc\Status::unimplemented());
  60. $writer->finish();
  61. }
  62. /**
  63. * A client-to-server streaming RPC.
  64. *
  65. * Accepts a stream of Points on a route being traversed, returning a
  66. * RouteSummary when traversal is completed.
  67. * @param \Grpc\ServerCallReader $reader read client request data of \Routeguide\Point
  68. * @param \Grpc\ServerContext $context server request context
  69. * @return \Routeguide\RouteSummary for response data, null if if error occured
  70. * initial metadata (if any) and status (if not ok) should be set to $context
  71. */
  72. public function RecordRoute(
  73. \Grpc\ServerCallReader $reader,
  74. \Grpc\ServerContext $context
  75. ): ?\Routeguide\RouteSummary {
  76. $context->setStatus(\Grpc\Status::unimplemented());
  77. return null;
  78. }
  79. /**
  80. * A Bidirectional streaming RPC.
  81. *
  82. * Accepts a stream of RouteNotes sent while a route is being traversed,
  83. * while receiving other RouteNotes (e.g. from other users).
  84. * @param \Grpc\ServerCallReader $reader read client request data of \Routeguide\RouteNote
  85. * @param \Grpc\ServerCallWriter $writer write response data of \Routeguide\RouteNote
  86. * @param \Grpc\ServerContext $context server request context
  87. * @return void
  88. */
  89. public function RouteChat(
  90. \Grpc\ServerCallReader $reader,
  91. \Grpc\ServerCallWriter $writer,
  92. \Grpc\ServerContext $context
  93. ): void {
  94. $context->setStatus(\Grpc\Status::unimplemented());
  95. $writer->finish();
  96. }
  97. /**
  98. * Get the method descriptors of the service for server registration
  99. *
  100. * @return array of \Grpc\MethodDescriptor for the service methods
  101. */
  102. public final function getMethodDescriptors(): array
  103. {
  104. return [
  105. '/routeguide.RouteGuide/GetFeature' => new \Grpc\MethodDescriptor(
  106. $this,
  107. 'GetFeature',
  108. '\Routeguide\Point',
  109. \Grpc\MethodDescriptor::UNARY_CALL
  110. ),
  111. '/routeguide.RouteGuide/ListFeatures' => new \Grpc\MethodDescriptor(
  112. $this,
  113. 'ListFeatures',
  114. '\Routeguide\Rectangle',
  115. \Grpc\MethodDescriptor::SERVER_STREAMING_CALL
  116. ),
  117. '/routeguide.RouteGuide/RecordRoute' => new \Grpc\MethodDescriptor(
  118. $this,
  119. 'RecordRoute',
  120. '\Routeguide\Point',
  121. \Grpc\MethodDescriptor::CLIENT_STREAMING_CALL
  122. ),
  123. '/routeguide.RouteGuide/RouteChat' => new \Grpc\MethodDescriptor(
  124. $this,
  125. 'RouteChat',
  126. '\Routeguide\RouteNote',
  127. \Grpc\MethodDescriptor::BIDI_STREAMING_CALL
  128. ),
  129. ];
  130. }
  131. }