conf.proto 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. TraceConf traceConf = 4;
  9. }
  10. message TraceConf {
  11. string endpoint = 1;
  12. string env = 2;
  13. }
  14. message Server {
  15. HTTP http = 1;
  16. GRPC grpc = 2;
  17. Registrar registrar = 3;
  18. }
  19. message HTTP {
  20. string network = 1;
  21. string addr = 2;
  22. google.protobuf.Duration timeout = 3;
  23. }
  24. message GRPC {
  25. string network = 1;
  26. string addr = 2;
  27. google.protobuf.Duration timeout = 3;
  28. }
  29. message Registrar {
  30. string namespace = 1;
  31. string group = 2;
  32. string endpoint = 3;
  33. }
  34. message Data {
  35. Database database = 1;
  36. Redis redis = 2;
  37. Mongo mongo = 3;
  38. }
  39. message Database {
  40. string driver = 1;
  41. string source = 2;
  42. int32 maxIdleConns = 3;
  43. int32 maxOpenConns = 4;
  44. }
  45. message Redis {
  46. string network = 1;
  47. string addr = 2;
  48. int32 db = 3;
  49. google.protobuf.Duration dial_timeout = 4;
  50. google.protobuf.Duration read_timeout = 5;
  51. google.protobuf.Duration write_timeout = 6;
  52. int32 poolSize = 7;
  53. int32 minIdleConns = 8;
  54. }
  55. message Mongo {
  56. string uri = 1;
  57. string database = 2;
  58. }