extend.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. }
  18. type AMap struct {
  19. Key string
  20. }
  21. type OLAPDB struct {
  22. Driver string
  23. Addr string
  24. Debug bool
  25. Database string
  26. Username string
  27. Password string
  28. MaxOpenConns int
  29. MaxIdleConns int
  30. }
  31. type Kafka struct {
  32. Brokers []string
  33. Topic string
  34. Consumers int
  35. MaxConcurrency int
  36. MetricsGroupId string
  37. }
  38. type Otel struct {
  39. // ServiceName string
  40. // ServiceVersion string
  41. // MetricsEndpoint string
  42. // MetriInterval int64
  43. Common OTelCommon
  44. Metrics OTelMetrics
  45. }
  46. type OTelCommon struct {
  47. ServiceName string
  48. ServiceVersion string
  49. Endpoint string // http endpoint
  50. GrpcEndpoint string
  51. }
  52. type OTelMetrics struct {
  53. Interval int64
  54. }
  55. type Prometheus struct {
  56. Address string
  57. }