config.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. Pre string //数据表前缀
  37. Startid int //查询MongoDB company_base 开始ID
  38. Endid int //查询MongoDB company_base 结束ID
  39. }
  40. type EsConf struct {
  41. URL string
  42. Username string
  43. Password string
  44. Index string
  45. }
  46. // LabelData 标签配置
  47. type LabelData struct {
  48. Name string // 标签名称
  49. Field []string //识别字段
  50. Sfield string //保存字段
  51. Rule []string // 具体规则
  52. RegRule []interface{} //规则的DFA
  53. Weight []float64 // 权重
  54. TotalWeight float64 // 最终合并后的权重
  55. }
  56. type Log struct {
  57. LogPath string
  58. MaxSize int
  59. Compress bool
  60. MaxAge int
  61. MaxBackups int
  62. LogLevel string
  63. Format string
  64. }
  65. type MysqlConf struct {
  66. Host string
  67. Username string
  68. Password string
  69. DB string
  70. }