增加跨域配置,以及增加配置说明
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"code.hoteas.com/hoteas/hotime"
|
||||
"database/sql"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func SetDB(appIns *hotime.Application) {
|
||||
appIns.SetConnectDB(func(err ...*hotime.Error) *sql.DB {
|
||||
db, e := sql.Open("sqlite3", appIns.Config.GetString("dbName"))
|
||||
if e != nil && len(err) != 0 {
|
||||
err[0].SetError(e)
|
||||
}
|
||||
return db
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user