ht_biz_config.go 692 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package config
  2. import "eta/eta_mini_ht_api/common/contants"
  3. // ESOpts es连接属性
  4. type HTOpts struct {
  5. ReportIndex string
  6. MediaIndex string
  7. }
  8. type HTBizConfig struct {
  9. BaseConfig
  10. opts HTOpts
  11. }
  12. func (e *HTBizConfig) GetReportIndex() string {
  13. return e.opts.ReportIndex
  14. }
  15. func (e *HTBizConfig) GetMediaIndex() string {
  16. return e.opts.MediaIndex
  17. }
  18. func (e *HTBizConfig) InitConfig() {
  19. opts := HTOpts{
  20. ReportIndex: e.GetString("es_report_index"),
  21. MediaIndex: e.GetString("es_media_index"),
  22. }
  23. e.opts = opts
  24. }
  25. func NewHT() Config {
  26. return &HTBizConfig{
  27. BaseConfig: BaseConfig{prefix: contants.HT},
  28. opts: HTOpts{},
  29. }
  30. }
  31. func init() {
  32. Register(contants.HT, NewHT)
  33. }