confs.proto 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. syntax = "proto3";
  2. package protos;
  3. import "structs.proto";
  4. // 项目中配置文件定义
  5. // zookeeper 连接配置
  6. message ZkConf {
  7. repeated string addrs = 1;
  8. string username = 2;
  9. string password = 3;
  10. int32 timeout = 4;
  11. }
  12. // redis 连接配置
  13. message RedisConf {
  14. repeated string addrs = 1;
  15. string password = 2;
  16. int32 db = 3;
  17. }
  18. // nats(-streaming) 连接配置
  19. message NatsConf {
  20. repeated string addrs = 1;
  21. string username = 2;
  22. string password = 3;
  23. string clusterId = 4;
  24. }
  25. // agent 服务器配置
  26. message AgentConf {
  27. ZkConf zoo = 1;
  28. string namespace = 2;
  29. uint64 id = 3;
  30. string addr = 4;
  31. string rpcAddr = 5;
  32. string profileAddr = 6;
  33. string agentAddr = 7;
  34. string logPath = 8;
  35. int32 level = 9;
  36. string mode = 10;
  37. }
  38. // zk 中 login 配置
  39. message LoginZkConf {
  40. repeated string addrs = 1;
  41. string password = 2;
  42. }
  43. // login 服务器启动配置
  44. // 因为 login 不在 zookeeper 中注册服务,所以 login 有两个配置
  45. message LoginConf {
  46. uint64 id = 1;
  47. RedisConf redis = 2;
  48. NatsConf nats = 3;
  49. repeated EmailConf emails = 4;
  50. string addr = 5;
  51. string agentAddr = 7;
  52. string rpcAddr = 9;
  53. string key = 11;
  54. string logPath = 12;
  55. int32 level = 14;
  56. string mode = 16;
  57. }
  58. message ManagerConf {
  59. ZkConf zoo = 1;
  60. string namespace = 2;
  61. uint64 id = 3;
  62. string addr = 4;
  63. string profileAddr = 6;
  64. string logPath = 8;
  65. int32 level = 9;
  66. string mode = 10;
  67. }
  68. message LogicConf {
  69. ZkConf zoo = 1;
  70. string namespace = 2;
  71. uint64 id = 3;
  72. string addr = 4;
  73. string rpcAddr = 5;
  74. string profileAddr = 6;
  75. string agentAddr = 7;
  76. string logPath = 8;
  77. int32 level = 9;
  78. string mode = 10;
  79. }
  80. message RouteRule_ {
  81. uint64 gameId = 1;
  82. Int32Scope scope = 2;
  83. }
  84. // 路由规则配置
  85. message RouteRules {
  86. repeated RouteRule_ rules = 1;
  87. }
  88. // smtp 服务器配置
  89. message EmailConf {
  90. string smtp = 1;
  91. int32 port = 2;
  92. string username = 3;
  93. string password = 4;
  94. string crypto = 5;
  95. }