basic.proto 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. string server = 1;
  44. int32 port = 2;
  45. string username = 3;
  46. string password = 4;
  47. string crypto = 5;
  48. }
  49. message SmsTemplate {
  50. string code = 1;
  51. string params = 2;
  52. }
  53. message SmsConf {
  54. string provider = 1;
  55. string sign_name = 2;
  56. string region = 3; // needed sometimes
  57. string access_key = 4;
  58. string secret_key = 5;
  59. }