config.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package main
  2. type GlobalConf struct {
  3. Mongo MgoConf
  4. MongoQy MgoConf
  5. Env EnvConf
  6. Esa EsConf
  7. Esb EsConf
  8. Clickhouse CkConf
  9. Log Log
  10. Mysql MysqlConf
  11. }
  12. type CkConf struct {
  13. Host string
  14. Username string
  15. Password string
  16. DB string
  17. }
  18. type MgoConf struct {
  19. Host string
  20. DB string
  21. Coll string // 查询表
  22. Username string
  23. Password string
  24. Size int
  25. Direct bool
  26. }
  27. type EnvConf struct {
  28. PortraitIndex string
  29. PortraitMgo string
  30. Start int
  31. End int
  32. Spec string
  33. Spec2 string
  34. Isw bool //是否保存标签里的权重
  35. Esindex string //ent_info
  36. }
  37. type EsConf struct {
  38. URL string
  39. Username string
  40. Password string
  41. Index string
  42. }
  43. // LabelData 标签配置
  44. type LabelData struct {
  45. Name string // 标签名称
  46. Field []string //识别字段
  47. Sfield string //保存字段
  48. Rule []string // 具体规则
  49. RegRule []interface{} //规则的DFA
  50. Weight []float64 // 权重
  51. TotalWeight float64 // 最终合并后的权重
  52. }
  53. type Log struct {
  54. LogPath string
  55. MaxSize int
  56. Compress bool
  57. MaxAge int
  58. MaxBackups int
  59. LogLevel string
  60. Format string
  61. }
  62. type MysqlConf struct {
  63. Host string
  64. Username string
  65. Password string
  66. DB string
  67. }