Browse Source

add rpc files

joe 4 years ago
parent
commit
b60b08c3b8
3 changed files with 60 additions and 0 deletions
  1. 23 0
      rpc_agent.proto
  2. 21 0
      rpc_common.proto
  3. 16 0
      rpc_logics.proto

+ 23 - 0
rpc_agent.proto

@@ -0,0 +1,23 @@
+syntax="proto3";
+package protos;
+
+option go_package = ".;protos";
+
+import "rpc_common.proto";
+
+service RpcAgent {
+  rpc Kick(KickUser) returns (RpcEcResp) {}
+  rpc Offline(RpcReqOffline) returns (RpcEcResp) {}
+  rpc Highway(PHighway) returns (RHighway) {}
+}
+
+message KickUser {
+  uint64 userId   = 1;    // who
+  int32 reason    = 2;    // why
+  int64 lasts     = 3;    // for how long
+}
+
+message RpcReqOffline {
+
+}
+

+ 21 - 0
rpc_common.proto

@@ -0,0 +1,21 @@
+syntax="proto3";
+package protos;
+
+option go_package = ".;protos";
+
+message RpcEcResp {
+  int32 ec = 1;
+}
+
+message PHighway {
+  string cmd        = 1;
+  string encoder    = 2;    // json/proto/msgpack/flatbuffer
+  string params     = 3;
+}
+
+message RHighway {
+  string cmd        = 1;
+  int32   ec        = 2;
+  string encoder    = 3;
+  string result     = 4;
+}

+ 16 - 0
rpc_logics.proto

@@ -0,0 +1,16 @@
+syntax="proto3";
+package protos;
+
+option go_package = ".;protos";
+
+import "rpc_common.proto";
+
+service RpcLobby {
+//  rpc IncrBalance() returns () {}
+//  rpc UpdateUser() returns () {}
+  rpc Highway(PHighway) returns (RHighway) {}
+}
+
+service RpcLogics {
+  rpc Highway(PHighway) returns (RHighway) {}
+}