options.proto 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 "google/protobuf/descriptor.proto";
  19. package brpc;
  20. option java_package="com.brpc";
  21. option java_outer_classname="Options";
  22. enum TalkType {
  23. TALK_TYPE_NORMAL = 0;
  24. TALK_TYPE_ONEWAY = 1;
  25. }
  26. enum ConnectionType {
  27. // bit-exclusive values since we may OR them to represent supported types.
  28. CONNECTION_TYPE_UNKNOWN = 0;
  29. CONNECTION_TYPE_SINGLE = 1;
  30. CONNECTION_TYPE_POOLED = 2;
  31. CONNECTION_TYPE_SHORT = 4;
  32. }
  33. enum ProtocolType {
  34. PROTOCOL_UNKNOWN = 0;
  35. PROTOCOL_BAIDU_STD = 1;
  36. PROTOCOL_STREAMING_RPC = 2;
  37. PROTOCOL_HULU_PBRPC = 3;
  38. PROTOCOL_SOFA_PBRPC = 4;
  39. PROTOCOL_RTMP = 5;
  40. PROTOCOL_THRIFT = 6;
  41. PROTOCOL_HTTP = 7;
  42. PROTOCOL_PUBLIC_PBRPC = 8;
  43. PROTOCOL_NOVA_PBRPC = 9;
  44. PROTOCOL_NSHEAD_CLIENT = 10; // implemented in baidu-rpc-ub
  45. PROTOCOL_NSHEAD = 11;
  46. PROTOCOL_HADOOP_RPC = 12;
  47. PROTOCOL_HADOOP_SERVER_RPC = 13;
  48. PROTOCOL_MONGO = 14; // server side only
  49. PROTOCOL_UBRPC_COMPACK = 15;
  50. PROTOCOL_DIDX_CLIENT = 16; // Client side only
  51. PROTOCOL_REDIS = 17; // Client side only
  52. PROTOCOL_MEMCACHE = 18; // Client side only
  53. PROTOCOL_ITP = 19;
  54. PROTOCOL_NSHEAD_MCPACK = 20;
  55. PROTOCOL_DISP_IDL = 21; // Client side only
  56. PROTOCOL_ERSDA_CLIENT = 22; // Client side only
  57. PROTOCOL_UBRPC_MCPACK2 = 23; // Client side only
  58. // Reserve special protocol for cds-agent, which depends on FIFO right now
  59. PROTOCOL_CDS_AGENT = 24; // Client side only
  60. PROTOCOL_ESP = 25; // Client side only
  61. PROTOCOL_H2 = 26;
  62. }
  63. enum CompressType {
  64. COMPRESS_TYPE_NONE = 0;
  65. COMPRESS_TYPE_SNAPPY = 1;
  66. COMPRESS_TYPE_GZIP = 2;
  67. COMPRESS_TYPE_ZLIB = 3;
  68. COMPRESS_TYPE_LZ4 = 4;
  69. }
  70. message ChunkInfo {
  71. required int64 stream_id = 1;
  72. required int64 chunk_id = 2;
  73. }
  74. extend google.protobuf.ServiceOptions {
  75. // Timeout in milliseconds, at service level.
  76. optional int64 service_timeout = 90000 [default = 10000];
  77. }
  78. extend google.protobuf.MethodOptions {
  79. // Talk type.
  80. optional TalkType request_talk_type = 90001 [default = TALK_TYPE_NORMAL];
  81. optional TalkType response_talk_type = 90002 [default = TALK_TYPE_NORMAL];
  82. // If set, override service_timeout.
  83. optional int64 method_timeout = 90003;
  84. // Compression for request/response.
  85. optional CompressType request_compression = 90004 [default = COMPRESS_TYPE_NONE];
  86. optional CompressType response_compression = 90005 [default = COMPRESS_TYPE_NONE];
  87. }