extend.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package config
  2. var ExtConfig Extend
  3. // Extend 扩展配置
  4. //
  5. // extend:
  6. // demo:
  7. // name: demo-name
  8. //
  9. // 使用方法: config.ExtConfig......即可!!
  10. type Extend struct {
  11. // AMap AMap // 这里配置对应配置文件的结构即可
  12. OLAPDB OLAPDB
  13. Kafka Kafka
  14. Otel Otel
  15. Prometheus Prometheus
  16. ClickhouseMetrics bool
  17. SmsConfig SmsConfig
  18. }
  19. type AMap struct {
  20. Key string
  21. }
  22. type OLAPDB struct {
  23. Driver string
  24. Addr string
  25. Debug bool
  26. Database string
  27. Username string
  28. Password string
  29. MaxOpenConns int
  30. MaxIdleConns int
  31. }
  32. type Kafka struct {
  33. Brokers []string
  34. Topic string
  35. Consumers int
  36. MaxConcurrency int
  37. MetricsGroupId string
  38. }
  39. type Otel struct {
  40. // ServiceName string
  41. // ServiceVersion string
  42. // MetricsEndpoint string
  43. // MetriInterval int64
  44. Common OTelCommon
  45. Metrics OTelMetrics
  46. }
  47. type OTelCommon struct {
  48. ServiceName string
  49. ServiceVersion string
  50. Endpoint string // http endpoint
  51. GrpcEndpoint string
  52. }
  53. type OTelMetrics struct {
  54. Interval int64
  55. }
  56. type Prometheus struct {
  57. Address string
  58. }
  59. type SmsConfig struct {
  60. Appkey string //:= "95598109"
  61. Appsecret string //:= "VXX8H0MzT7"
  62. Url string `json:"url"`
  63. AppsGroup string //1:17233413341,18723344112;2:17233413341,18723344112;3:17233413341,18723344112
  64. SmsTpl string
  65. // SqlRecord bool
  66. }