confs.proto 2.2 KB

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