conf.proto 1.1 KB

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