Commit 9021543e by mushishixian

测试通过redis

parent 5ee28309
...@@ -2,6 +2,7 @@ package boot ...@@ -2,6 +2,7 @@ package boot
import ( import (
"jtthink/pkg/config" "jtthink/pkg/config"
"jtthink/pkg/gredis"
"jtthink/pkg/mysql" "jtthink/pkg/mysql"
) )
...@@ -12,5 +13,8 @@ func Boot() (err error) { ...@@ -12,5 +13,8 @@ func Boot() (err error) {
if err = mysql.Setup(); err != nil { if err = mysql.Setup(); err != nil {
return return
} }
if err = gredis.Setup(); err != nil {
return
}
return return
} }
...@@ -7,6 +7,10 @@ table_prefix = ...@@ -7,6 +7,10 @@ table_prefix =
type = mysql type = mysql
[redis] [redis]
write_host = 192.168.1.235:6379
read_host = 192.168.1.235:6379
write_password = icDb29mLy2s
read_password = icDb29mLy2s
max_idle = 10 max_idle = 10
max_active = 10 max_active = 10
idle_timeout = 20 idle_timeout = 20
\ No newline at end of file
package main
import (
"fmt"
"github.com/gomodule/redigo/redis"
"jtthink/boot"
"jtthink/pkg/gredis"
)
func main() {
boot.Boot()
gredis.Delete("testKey")
//gredis.HDelete("testHKey", 1)
fmt.Println(redis.String(gredis.Get("testKey")))
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment