conf.proto 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. string endpoint = 3;
  30. }
  31. HTTP http = 1;
  32. GRPC grpc = 2;
  33. Registrar registrar = 3;
  34. }
  35. message Data {
  36. message Database {
  37. string driver = 1;
  38. string source = 2;
  39. int32 maxIdleConns = 3;
  40. int32 maxOpenConns = 4;
  41. }
  42. message Redis {
  43. string network = 1;
  44. string addr = 2;
  45. int32 db = 3;
  46. google.protobuf.Duration dial_timeout = 4;
  47. google.protobuf.Duration read_timeout = 5;
  48. google.protobuf.Duration write_timeout = 6;
  49. int32 poolSize = 7;
  50. int32 minIdleConns = 8;
  51. }
  52. Database database = 1;
  53. Redis redis = 2;
  54. }
  55. message JWT {
  56. string secret = 1;
  57. int64 expire = 2;
  58. }