service_test.go 647 B

1234567891011121314151617181920212223242526272829303132
  1. package service
  2. import (
  3. "flag"
  4. "go-common/app/admin/main/laser/conf"
  5. "os"
  6. )
  7. var (
  8. s *Service
  9. )
  10. func init() {
  11. if os.Getenv("DEPLOY_ENV") != "" {
  12. flag.Set("app_id", "mobile.studio.laser-admin")
  13. flag.Set("conf_token", "25911b439f4636ce9083f91c4882dffa")
  14. flag.Set("tree_id", "19167")
  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/laser-admin.toml")
  23. }
  24. flag.Parse()
  25. if err := conf.Init(); err != nil {
  26. panic(err)
  27. }
  28. s = New(conf.Conf)
  29. }