mongo.proto 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. package brpc.policy;
  19. option cc_generic_services = true;
  20. option java_generic_services = true;
  21. option java_package="com.brpc.policy";
  22. option java_outer_classname="MongoProto";
  23. enum MongoOp {
  24. OPREPLY = 1;
  25. DBMSG = 1000;
  26. DB_UPDATE = 2001;
  27. DB_INSERT = 2002;
  28. DB_QUERY = 2004;
  29. DB_GETMORE = 2005;
  30. DB_DELETE = 2006;
  31. DB_KILLCURSORS = 2007;
  32. DB_COMMAND = 2008;
  33. DB_COMMANDREPLY = 2009;
  34. }
  35. message MongoHeader {
  36. required int32 message_length = 1;
  37. required int32 request_id = 2;
  38. required int32 response_to = 3;
  39. required MongoOp op_code = 4;
  40. }
  41. message MongoRequest {
  42. required MongoHeader header = 1;
  43. required string message = 2;
  44. }
  45. message MongoResponse {
  46. required MongoHeader header = 1;
  47. required int32 response_flags = 2;
  48. required int64 cursor_id = 3;
  49. required int32 starting_from = 4;
  50. required int32 number_returned = 5;
  51. required string message = 6;
  52. }
  53. service MongoService {
  54. rpc default_method(MongoRequest) returns (MongoResponse);
  55. }