mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
新增redis模块
This commit is contained in:
24
sysmodule/RedisModule_test.go
Normal file
24
sysmodule/RedisModule_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package sysmodule
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRedisModule(t *testing.T) {
|
||||
var cfg ConfigRedis
|
||||
var module RedisModule
|
||||
|
||||
cfg.IP = "192.168.0.5"
|
||||
cfg.Password = ""
|
||||
cfg.Port = "6379"
|
||||
cfg.IdleTimeout = 2
|
||||
cfg.MaxActive = 3
|
||||
cfg.MaxIdle = 3
|
||||
cfg.DbIndex = 15
|
||||
module.Init(&cfg)
|
||||
|
||||
module.SetRedisHash("rediskey", "hashkey", "1111")
|
||||
ret, err := module.GetRedisHashValueByKey("rediskey", "hashkey")
|
||||
fmt.Print(ret, err)
|
||||
}
|
||||
Reference in New Issue
Block a user