conf.proto 1.2 KB

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