basic.proto 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. syntax = "proto3";
  2. package cproto;
  3. option go_package = "./;cproto";
  4. // net address
  5. message Address {
  6. string ip = 1;
  7. int32 port = 2;
  8. }
  9. message Scope {
  10. int32 min = 1;
  11. int32 max = 2;
  12. }
  13. // support MySQL, Postgresql, redis etc.
  14. message StoreConf {
  15. string type = 1;
  16. string addr = 2; // host:port
  17. string username = 3;
  18. string password = 4;
  19. int32 timeout = 5;
  20. string db = 6; // to int32 if db refer a redis db.
  21. }
  22. message ClusterConf {
  23. repeated string addrs = 1;
  24. string username = 2;
  25. string password = 3;
  26. string cluster_id = 4;
  27. int32 timeout = 5;
  28. string db = 6;
  29. }
  30. message LogConf {
  31. string path = 1;
  32. string level = 2;
  33. int32 max_size = 3;
  34. int32 max_age = 4;
  35. int32 max_backups = 5;
  36. int32 compress = 6;
  37. }
  38. message MessageTemplate {
  39. string subject = 1;
  40. string body = 2;
  41. }
  42. message SmtpConf {
  43. int32 enabled = 1;
  44. string server = 2;
  45. int32 port = 3;
  46. string username = 4;
  47. string password = 5;
  48. string crypto = 6;
  49. repeated string to = 7;
  50. }
  51. message SmsTemplate {
  52. string code = 1;
  53. string params = 2;
  54. }
  55. message SmsConf {
  56. int32 enabled = 1;
  57. string provider = 2;
  58. string sign_name = 3;
  59. string region = 4; // needed sometimes
  60. string access_key = 5;
  61. string secret_key = 6;
  62. repeated string to = 7;
  63. }