service_test.go 645 B

123456789101112131415161718192021222324252627282930313233
  1. package service
  2. import (
  3. "flag"
  4. "os"
  5. "go-common/app/admin/main/mcn/conf"
  6. )
  7. var (
  8. s *Service
  9. )
  10. func init() {
  11. if os.Getenv("DEPLOY_ENV") != "" {
  12. flag.Set("app_id", "main.account.mcn-admin")
  13. flag.Set("conf_token", "BVWgBtBvS2pkTBbmxAl0frX6KRA14d5P")
  14. flag.Set("tree_id", "6813")
  15. flag.Set("conf_version", "docker-1")
  16. flag.Set("deploy_env", "uat")
  17. flag.Set("conf_host", "config.bilibili.co")
  18. flag.Set("conf_path", "/tmp")
  19. flag.Set("region", "sh")
  20. flag.Set("zone", "sh001")
  21. } else {
  22. flag.Set("conf", "../cmd/mcn-admin-test.toml")
  23. }
  24. flag.Parse()
  25. if err := conf.Init(); err != nil {
  26. panic(err)
  27. }
  28. s = New(conf.Conf)
  29. }