factory.go 378 字节
Newer Older
Y
Your Name 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
package pdao

import "database/sql"

//FactoryFunc factoryFunc
type FactoryFunc func(db *sql.DB) (interface{}, error)

//Create create
func (f FactoryFunc) Create(db *sql.DB) (interface{}, error) {
	return f(db)
}

//Factory factory
type Factory interface {
	Create(db *sql.DB) (interface{}, error)
}

//DBBuilder dbBuilder
type DBBuilder interface {
	Build(db *sql.DB) error
}