conf.proto 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. string data = 4;
  34. }
  35. message Data {
  36. Database database = 1;
  37. Redis redis = 2;
  38. Mongo mongo = 3;
  39. }
  40. message Database {
  41. string driver = 1;
  42. string source = 2;
  43. int32 maxIdleConns = 3;
  44. int32 maxOpenConns = 4;
  45. }
  46. message Redis {
  47. string network = 1;
  48. string addr = 2;
  49. int32 db = 3;
  50. google.protobuf.Duration dial_timeout = 4;
  51. google.protobuf.Duration read_timeout = 5;
  52. google.protobuf.Duration write_timeout = 6;
  53. int32 poolSize = 7;
  54. int32 minIdleConns = 8;
  55. }
  56. message Mongo {
  57. string uri = 1;
  58. string database = 2;
  59. }