echo.proto 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // Licensed to the Apache Software Foundation (ASF) under one
  2. // or more contributor license agreements. See the NOTICE file
  3. // distributed with this work for additional information
  4. // regarding copyright ownership. The ASF licenses this file
  5. // to you under the Apache License, Version 2.0 (the
  6. // "License"); you may not use this file except in compliance
  7. // with the License. You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing,
  12. // software distributed under the License is distributed on an
  13. // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. // KIND, either express or implied. See the License for the
  15. // specific language governing permissions and limitations
  16. // under the License.
  17. syntax="proto2";
  18. import "idl_options.proto";
  19. option (idl_support) = true;
  20. option cc_generic_services = true;
  21. package test;
  22. message EchoRequest {
  23. required string message = 1;
  24. optional int32 code = 2;
  25. optional bool close_fd = 3;
  26. optional int32 sleep_us = 4;
  27. optional int32 server_fail = 5;
  28. };
  29. message EchoResponse {
  30. required string message = 1;
  31. repeated int32 code_list = 2;
  32. optional uint64 receiving_socket_id = 3;
  33. };
  34. message ComboRequest {
  35. repeated EchoRequest requests = 1;
  36. };
  37. message BytesRequest {
  38. required bytes databytes = 1;
  39. };
  40. message BytesResponse {
  41. required bytes databytes = 1;
  42. };
  43. message ComboResponse {
  44. repeated EchoResponse responses = 1;
  45. };
  46. service EchoService {
  47. rpc Echo(EchoRequest) returns (EchoResponse);
  48. rpc ComboEcho(ComboRequest) returns (ComboResponse);
  49. rpc BytesEcho1(BytesRequest) returns (BytesResponse);
  50. rpc BytesEcho2(BytesRequest) returns (BytesResponse);
  51. }
  52. message HttpRequest {}
  53. message HttpResponse {}
  54. service DownloadService {
  55. rpc Download(HttpRequest) returns (HttpResponse);
  56. rpc DownloadFailed(HttpRequest) returns (HttpResponse);
  57. }
  58. service UserNamingService {
  59. rpc ListNames(HttpRequest) returns (HttpResponse);
  60. rpc Touch(HttpRequest) returns (HttpResponse);
  61. };
  62. service DiscoveryNamingService {
  63. rpc Nodes(HttpRequest) returns (HttpResponse);
  64. rpc Fetchs(HttpRequest) returns (HttpResponse);
  65. rpc Register(HttpRequest) returns (HttpResponse);
  66. rpc Renew(HttpRequest) returns (HttpResponse);
  67. rpc Cancel(HttpRequest) returns (HttpResponse);
  68. };
  69. enum State0 {
  70. STATE0_NUM_0 = 0;
  71. STATE0_NUM_1 = 1;
  72. STATE0_NUM_2 = 2;
  73. };
  74. enum State1 {
  75. STATE1_NUM_0 = 0;
  76. STATE1_NUM_1 = 1;
  77. };
  78. message Message1 {
  79. required State0 stat = 1;
  80. };
  81. message Message2 {
  82. required State1 stat = 1;
  83. };