This commit is contained in:
hoteas
2018-04-03 17:54:27 +00:00
parent 6ecdd575aa
commit 1de2c6e8b6
14 changed files with 405 additions and 385 deletions
+1 -1
View File
@@ -14,5 +14,5 @@
"logLevel": 0,
"port": "80",
"sessionName": "HOTIME",
"tpt": "tpt"
"tpt": "example/tpt"
}
+16 -1
View File
@@ -10,6 +10,21 @@ import (
func main() {
x:=hotime.CacheMemory{}
x.Cache("x",123)
for i:=0;i<10000000 ;i++ {
go func() {
x.Cache("y",i)
fmt.Println(x.Cache("y"))
fmt.Println(x.Cache("y",nil))
}()
}
appIns := hotime.Application{}
i := 0
@@ -21,7 +36,7 @@ func main() {
})
//手动模式,
appIns.SetConfig()
appIns.SetConfig("example/config/config.json")
appIns.SetConnectDB(func(err ...*hotime.Error) *sql.DB {
query := appIns.Config.GetString("dbUser") + ":" + appIns.Config.GetString("dbPwd") +
"@tcp(" + appIns.Config.GetString("dbHost") + ":" + appIns.Config.GetString("dbPort") + ")/" + appIns.Config.GetString("dbName") + "?charset=utf8"