config.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package config
  2. import (
  3. spider_com "KeyWebsiteMonitor/util"
  4. )
  5. type (
  6. Config struct {
  7. RunModel string `yaml:"run_model"`
  8. WebsocketURL string `yaml:"websocket_url"` //仅远程浏览器有用
  9. ProxyAddr string `yaml:"proxy_address"` //仅本地浏览器有用
  10. HeadLess bool `yaml:"headless"`
  11. ShowImage bool `yaml:"show_image"`
  12. StorageType string `yaml:"storage"`
  13. StorageMongoURI string `yaml:"mongo_address"`
  14. StorageMongoDB string `yaml:"mongo_db"`
  15. StorageMongoCollection string `yaml:"mongo_colesstion"`
  16. StorageFile string `yaml:"storage_file"`
  17. WeChatRobotURL string `yaml:"wechat_robot_url"`
  18. DownloadPath string `yaml:"download_path"`
  19. CronTime string `yaml:"cron_time"`
  20. CronLuaconfig string `yaml:"cron_luaconfig"`
  21. GetTaskUrl string `yaml:"get_task_url"`
  22. MongoSpiderAddress string `yaml:"mongo_spider_address"`
  23. MongoSpiderDb string `yaml:"mongo_spider_db"`
  24. MongoCommonAddress string `yaml:"mongo_common_address"`
  25. MongoCommonDb string `yaml:"mongo_common_db"`
  26. Redisaddrs string `yaml:"redisaddrs"`
  27. Name string `yaml:"name"`
  28. CompletionTaskUrl string `yaml:"completion_task_url"`
  29. }
  30. )
  31. var (
  32. Sysconfig *Config = new(Config)
  33. )
  34. // init
  35. func init() {
  36. // JyLogInit()
  37. // time.Sleep(2 * time.Second)
  38. spider_com.LoadConfig("./config.yaml", Sysconfig)
  39. }