consumer/provider에 Authorization타입으로 고정
This commit is contained in:
@ -10,18 +10,13 @@ import (
|
||||
"repositories.action2quare.com/ayo/gocommon/logger"
|
||||
)
|
||||
|
||||
type sessioninfo struct {
|
||||
Platform string
|
||||
Uid string
|
||||
}
|
||||
|
||||
func TestExpTable(t *testing.T) {
|
||||
pv, err := NewProvider[sessioninfo](context.Background(), "redis://192.168.8.94:6380/1", 10*time.Second)
|
||||
pv, err := NewProvider(context.Background(), "redis://192.168.8.94:6380/1", 10*time.Second)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
cs, err := NewConsumer[sessioninfo](context.Background(), "redis://192.168.8.94:6380/1", 10*time.Second)
|
||||
cs, err := NewConsumer(context.Background(), "redis://192.168.8.94:6380/1", 10*time.Second)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@ -37,13 +32,15 @@ func TestExpTable(t *testing.T) {
|
||||
}()
|
||||
|
||||
time.Sleep(2 * time.Second)
|
||||
pv.Update(newid1.Hex(), &sessioninfo{
|
||||
pv.Update(newid1.Hex(), &Authorization{
|
||||
Account: newid1.Hex(),
|
||||
Platform: "editor",
|
||||
Uid: "uid-1",
|
||||
})
|
||||
|
||||
time.Sleep(2 * time.Second)
|
||||
pv.Update(newid2.Hex(), &sessioninfo{
|
||||
pv.Update(newid2.Hex(), &Authorization{
|
||||
Account: newid2.Hex(),
|
||||
Platform: "editor",
|
||||
Uid: "uid-2",
|
||||
})
|
||||
@ -61,7 +58,7 @@ func TestExpTable(t *testing.T) {
|
||||
cs.Touch(newid2.Hex())
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
cs2, err := NewConsumer[sessioninfo](context.Background(), "redis://192.168.8.94:6380/1", 10*time.Second)
|
||||
cs2, err := NewConsumer(context.Background(), "redis://192.168.8.94:6380/1", 10*time.Second)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user