数据库缓存更新

This commit is contained in:
hoteas
2018-04-09 17:16:24 +00:00
parent 546058513f
commit e5eaa97ff9
8 changed files with 446 additions and 205 deletions
+8 -3
View File
@@ -8,13 +8,12 @@ import (
//"go.hoteas.com/hotime/cache"
"golang.org/x/net/websocket"
"time"
"go.hoteas.com/hotime/cache"
)
func main() {
appIns := hotime.Application{}
@@ -32,8 +31,14 @@ func main() {
//手动模式,
appIns.SetConfig("example/config/config.json")
//redis缓存接入
//ca:=hotime.CacheIns(&cache.CacheRedis{Host:appIns.Config.GetString("redisHost"),Pwd:appIns.Config.GetString("redisPwd"),Time:appIns.Config.GetCeilInt64("cacheLongTime")})
//ca.Cache("xyzm","dasdas")
//ca.Cache("xyzn","dasdas")
//ca.Cache("xyzo","dasdas")
//ca.Cache("xyz*",nil)
//fmt.Println(ca.Cache("xyzm").Data)
appIns.SetConnectDB(func(err ...*hotime.Error) *sql.DB {
query := appIns.Config.GetString("dbUser") + ":" + appIns.Config.GetString("dbPwd") +