test.proto 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // test proto
  2. syntax = "proto3";
  3. package test;
  4. import "base/common.proto";
  5. import "google/protobuf/any.proto";
  6. option go_package = "github.com/test";
  7. message Req {
  8. string in = 1;
  9. common.User user = 2;
  10. google.protobuf.Any object = 4;
  11. }
  12. message Reply {
  13. string out = 1;
  14. }
  15. message snake_req {}
  16. message snake_reply {}
  17. message CamelReq{}
  18. message CamelReply{}
  19. message EnumMessage {
  20. enum Enum {
  21. unknown = 0;
  22. male = 1;
  23. female = 2;
  24. }
  25. }
  26. message CommonReply{}
  27. message MapReq{
  28. map<string, string> m = 1;
  29. }
  30. message RepeatedReq{
  31. repeated string id = 1;
  32. }
  33. service Test_Service {
  34. // service
  35. rpc Service (Req) returns (Reply);
  36. // greet service
  37. rpc GreetService (Req) returns (Reply);
  38. // case snake
  39. rpc snake_service (snake_req) returns (snake_reply);
  40. // case camel
  41. rpc CamelService (CamelReq) returns (CamelReply);
  42. // case enum
  43. rpc EnumService (EnumMessage) returns (CommonReply);
  44. // case map
  45. rpc MapService (MapReq) returns (CommonReply);
  46. // case repeated
  47. rpc RepeatedService (RepeatedReq) returns (CommonReply);
  48. }