43 lines
624 B
Go
43 lines
624 B
Go
package redis
|
|
|
|
import (
|
|
"fmt"
|
|
"service/library/configcenter"
|
|
"testing"
|
|
)
|
|
|
|
func TestCalcSignature(t *testing.T) {
|
|
|
|
cfg := &configcenter.RedisConfig{
|
|
Uri: "localhost:6379",
|
|
Password: "",
|
|
MaxActive: 0,
|
|
MaxIdle: 0,
|
|
IdleTimeout: 0,
|
|
Prefix: "",
|
|
}
|
|
cli, err := NewRedisClient(cfg)
|
|
if err != nil {
|
|
fmt.Printf("err: %v", err)
|
|
return
|
|
}
|
|
list := make([]int64, 5)
|
|
list[0] = 0
|
|
list[1] = 0
|
|
list[2] = 0
|
|
list[3] = 0
|
|
list[4] = 0
|
|
l := make([]int64, 0)
|
|
cli.Set("test", list, 60*5)
|
|
err = cli.GetObject("test", &l)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
fmt.Println(l)
|
|
|
|
}
|
|
|
|
func ConnRedis() {
|
|
|
|
}
|