|
- package zyos_go_coupon
-
- import (
- "code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/db"
- "code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/md"
- )
-
- var cfg = md.DBCfg{
- Host: "",
- Name: "",
- User: "",
- Psw: "",
- ShowLog: false,
- MaxLifetime: 0,
- MaxOpenConns: 0,
- MaxIdleConns: 0,
- Path: "",
- }
-
- func Init(host, name, user, psw string) error {
- cfg.Host = host
- cfg.Name = name
- cfg.User = user
- cfg.Psw = psw
- cfg.ShowLog = true
- cfg.MaxLifetime = 30
- cfg.MaxOpenConns = 100
- cfg.MaxIdleConns = 100
- if err := db.InitDB(&cfg); err != nil {
- return err
- }
- return nil
- }
|