conf.proto 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. syntax = "proto3";
  2. package kratos.api;
  3. option go_package = "github.com/go-kratos/kratos-layout/internal/conf;conf";
  4. import "google/protobuf/duration.proto";
  5. message Bootstrap {
  6. Server server = 1;
  7. Data data = 2;
  8. JWT jwt = 3;
  9. TraceConf traceConf = 4;
  10. }
  11. message TraceConf {
  12. string endpoint = 1;
  13. string env = 2;
  14. }
  15. message JWT {
  16. string secret = 1;
  17. int64 expire = 2;
  18. }
  19. message Server {
  20. HTTP http = 1;
  21. GRPC grpc = 2;
  22. Registrar registrar = 3;
  23. }
  24. message HTTP {
  25. string network = 1;
  26. string addr = 2;
  27. google.protobuf.Duration timeout = 3;
  28. }
  29. message GRPC {
  30. string network = 1;
  31. string addr = 2;
  32. google.protobuf.Duration timeout = 3;
  33. }
  34. message Registrar {
  35. string namespace = 1;
  36. string group = 2;
  37. string endpoint = 3;
  38. }
  39. message Data {
  40. Database database = 1;
  41. Redis redis = 2;
  42. Mongo mongo = 3;
  43. }
  44. message Database {
  45. string driver = 1;
  46. string source = 2;
  47. int32 maxIdleConns = 3;
  48. int32 maxOpenConns = 4;
  49. }
  50. message Redis {
  51. string network = 1;
  52. string addr = 2;
  53. int32 db = 3;
  54. google.protobuf.Duration dial_timeout = 4;
  55. google.protobuf.Duration read_timeout = 5;
  56. google.protobuf.Duration write_timeout = 6;
  57. int32 poolSize = 7;
  58. int32 minIdleConns = 8;
  59. }
  60. message Mongo {
  61. string uri = 1;
  62. string database = 2;
  63. }