V2bX/api/iprecoder/redis_test.go

25 lines
414 B
Go
Raw Normal View History

2022-11-01 22:26:04 -04:00
package iprecoder
import (
"log"
"testing"
2023-07-29 07:27:15 -04:00
"github.com/InazumaV/V2bX/conf"
"github.com/InazumaV/V2bX/limiter"
2022-11-01 22:26:04 -04:00
)
func TestRedis_SyncOnlineIp(t *testing.T) {
r := NewRedis(&conf.RedisConfig{
Address: "127.0.0.1:6379",
Password: "",
Db: 0,
})
users, err := r.SyncOnlineIp([]limiter.UserIpList{
2022-11-02 02:54:24 -04:00
{1, []string{"5.5.5.5", "4.4.4.4"}},
2022-11-01 22:26:04 -04:00
})
if err != nil {
t.Fatal(err)
}
log.Println(users)
}