api.proto 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // +bili:type=service
  2. // Code generated by warden.
  3. syntax = "proto3";
  4. package push.service.broadcast;
  5. option go_package = "v1";
  6. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  7. import "app/service/main/broadcast/model/model.proto";
  8. message CloseReply {
  9. }
  10. message CloseReq {
  11. }
  12. message PingReply {
  13. }
  14. message PingReq {
  15. }
  16. message ConnectReq {
  17. option (gogoproto.goproto_stringer) = false;
  18. string server = 1;
  19. string serverKey = 2;
  20. string cookie = 3;
  21. bytes token = 4;
  22. }
  23. message ConnectReply {
  24. int64 mid = 1;
  25. string key = 2;
  26. string roomID = 3;
  27. string platform = 4;
  28. repeated int32 accepts = 5;
  29. }
  30. message DisconnectReq {
  31. int64 mid = 1;
  32. string key = 2;
  33. string server = 3;
  34. }
  35. message DisconnectReply {
  36. bool has = 1;
  37. }
  38. message HeartbeatReq {
  39. int64 mid = 1;
  40. string key = 2;
  41. string server = 3;
  42. }
  43. message HeartbeatReply {
  44. }
  45. message OnlineReq {
  46. option (gogoproto.goproto_stringer) = false;
  47. string server = 1;
  48. map<string, int32> roomCount = 2;
  49. int32 sharding = 3;
  50. }
  51. message OnlineReply {
  52. option (gogoproto.goproto_stringer) = false;
  53. map<string, int32> roomCount = 1;
  54. }
  55. message ReceiveReq {
  56. int64 mid = 1;
  57. push.service.broadcast.model.Proto proto = 2;
  58. }
  59. message ReceiveReply {
  60. push.service.broadcast.model.Proto proto = 1;
  61. }
  62. message ServerListReq {
  63. string platform = 1;
  64. }
  65. message ServerListReply {
  66. string domain = 1 [(gogoproto.jsontag) = "domain"];
  67. int32 tcpPort = 2 [(gogoproto.jsontag) = "tcp_port"];
  68. int32 wsPort = 3 [(gogoproto.jsontag) = "ws_port"];
  69. int32 wssPort = 4 [(gogoproto.jsontag) = "wss_port"];
  70. int32 heartbeat = 5 [(gogoproto.jsontag) = "heartbeat"];
  71. repeated string nodes = 6 [(gogoproto.jsontag) = "nodes"];
  72. Backoff backoff = 7 [(gogoproto.jsontag) = "backoff"];
  73. int32 heartbeatMax = 8 [(gogoproto.jsontag) = "heartbeat_max"];
  74. }
  75. message Backoff {
  76. int32 MaxDelay = 1 [(gogoproto.jsontag) = "max_delay"];
  77. int32 BaseDelay = 2 [(gogoproto.jsontag) = "base_delay"];
  78. float Factor = 3 [(gogoproto.jsontag) = "factor"];
  79. float Jitter = 4 [(gogoproto.jsontag) = "jitter"];
  80. }
  81. service Zerg {
  82. // Ping Service
  83. rpc Ping(PingReq) returns(PingReply);
  84. // Close Service
  85. rpc Close(CloseReq) returns(CloseReply);
  86. // Connect
  87. rpc Connect(ConnectReq) returns (ConnectReply);
  88. // Disconnect
  89. rpc Disconnect(DisconnectReq) returns (DisconnectReply);
  90. // Heartbeat
  91. rpc Heartbeat(HeartbeatReq) returns (HeartbeatReply);
  92. // RenewOnline
  93. rpc RenewOnline(OnlineReq) returns (OnlineReply);
  94. // Receive
  95. rpc Receive(ReceiveReq) returns (ReceiveReply);
  96. //ServerList
  97. rpc ServerList(ServerListReq) returns (ServerListReply);
  98. }