mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
add redis ip recorder
This commit is contained in:
23
api/iprecoder/redis_test.go
Normal file
23
api/iprecoder/redis_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package iprecoder
|
||||
|
||||
import (
|
||||
"github.com/Yuzuki616/V2bX/conf"
|
||||
"github.com/Yuzuki616/V2bX/core/app/dispatcher"
|
||||
"log"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRedis_SyncOnlineIp(t *testing.T) {
|
||||
r := NewRedis(&conf.RedisConfig{
|
||||
Address: "127.0.0.1:6379",
|
||||
Password: "",
|
||||
Db: 0,
|
||||
})
|
||||
users, err := r.SyncOnlineIp([]dispatcher.UserIpList{
|
||||
{2, []string{"3.3.3.3", "4.4.4.4"}},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
log.Println(users)
|
||||
}
|
||||
Reference in New Issue
Block a user