config.go 1.4 KB

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