支付模块
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

34 行
606 B

  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. if err := db.InitDB(&cfg); err != nil {
  27. return err
  28. }
  29. return nil
  30. }