支付模块
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.go 634 B

2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334
  1. package pay
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/db"
  4. "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/md"
  5. )
  6. var cfg = md.DBCfg{
  7. Host: "",
  8. Name: "",
  9. User: "",
  10. Psw: "",
  11. ShowLog: false,
  12. MaxLifetime: 0,
  13. MaxOpenConns: 0,
  14. MaxIdleConns: 0,
  15. Path: "",
  16. }
  17. func Init(host, name, user, psw string) error {
  18. cfg.Host = host
  19. cfg.Name = name
  20. cfg.User = user
  21. cfg.Psw = psw
  22. cfg.ShowLog = true
  23. cfg.MaxLifetime = 30
  24. cfg.MaxOpenConns = 100
  25. cfg.MaxIdleConns = 100
  26. cfg.Path = "./tmp/%s.logs"
  27. if err := db.InitDB(&cfg); err != nil {
  28. return err
  29. }
  30. return nil
  31. }