go-common/app/job/main/archive/dao/result/dao.go

29 lines
439 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package result
import (
"context"
"go-common/app/job/main/archive/conf"
"go-common/library/database/sql"
)
// Dao is redis dao.
type Dao struct {
c *conf.Config
db *sql.DB
}
// New is new redis dao.
func New(c *conf.Config) (d *Dao) {
d = &Dao{
c: c,
db: sql.NewMySQL(c.DB.Result),
}
return d
}
// BeginTran begin transcation.
func (d *Dao) BeginTran(c context.Context) (tx *sql.Tx, err error) {
return d.db.Begin(c)
}