type definition of room name (#311)

* WIP commit

* update protocol

* Fixing a test and catching one place where casting was missed

* Fix one more spot which need conversion from livekit.RoomName -> string

* do not covert list
This commit is contained in:
Raja Subramanian
2022-01-02 16:49:16 +05:30
committed by GitHub
parent 66a1ffe414
commit 3a9009ae12
21 changed files with 208 additions and 208 deletions
+36 -36
View File
@@ -10,11 +10,11 @@ import (
)
type FakeRouter struct {
ClearRoomStateStub func(context.Context, string) error
ClearRoomStateStub func(context.Context, livekit.RoomName) error
clearRoomStateMutex sync.RWMutex
clearRoomStateArgsForCall []struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
}
clearRoomStateReturns struct {
result1 error
@@ -26,11 +26,11 @@ type FakeRouter struct {
drainMutex sync.RWMutex
drainArgsForCall []struct {
}
GetNodeForRoomStub func(context.Context, string) (*livekit.Node, error)
GetNodeForRoomStub func(context.Context, livekit.RoomName) (*livekit.Node, error)
getNodeForRoomMutex sync.RWMutex
getNodeForRoomArgsForCall []struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
}
getNodeForRoomReturns struct {
result1 *livekit.Node
@@ -82,11 +82,11 @@ type FakeRouter struct {
removeDeadNodesReturnsOnCall map[int]struct {
result1 error
}
SetNodeForRoomStub func(context.Context, string, string) error
SetNodeForRoomStub func(context.Context, livekit.RoomName, string) error
setNodeForRoomMutex sync.RWMutex
setNodeForRoomArgsForCall []struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 string
}
setNodeForRoomReturns struct {
@@ -105,11 +105,11 @@ type FakeRouter struct {
startReturnsOnCall map[int]struct {
result1 error
}
StartParticipantSignalStub func(context.Context, string, routing.ParticipantInit) (string, routing.MessageSink, routing.MessageSource, error)
StartParticipantSignalStub func(context.Context, livekit.RoomName, routing.ParticipantInit) (string, routing.MessageSink, routing.MessageSource, error)
startParticipantSignalMutex sync.RWMutex
startParticipantSignalArgsForCall []struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 routing.ParticipantInit
}
startParticipantSignalReturns struct {
@@ -138,11 +138,11 @@ type FakeRouter struct {
unregisterNodeReturnsOnCall map[int]struct {
result1 error
}
WriteParticipantRTCStub func(context.Context, string, string, *livekit.RTCNodeMessage) error
WriteParticipantRTCStub func(context.Context, livekit.RoomName, string, *livekit.RTCNodeMessage) error
writeParticipantRTCMutex sync.RWMutex
writeParticipantRTCArgsForCall []struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 string
arg4 *livekit.RTCNodeMessage
}
@@ -152,11 +152,11 @@ type FakeRouter struct {
writeParticipantRTCReturnsOnCall map[int]struct {
result1 error
}
WriteRoomRTCStub func(context.Context, string, string, *livekit.RTCNodeMessage) error
WriteRoomRTCStub func(context.Context, livekit.RoomName, string, *livekit.RTCNodeMessage) error
writeRoomRTCMutex sync.RWMutex
writeRoomRTCArgsForCall []struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 string
arg4 *livekit.RTCNodeMessage
}
@@ -170,12 +170,12 @@ type FakeRouter struct {
invocationsMutex sync.RWMutex
}
func (fake *FakeRouter) ClearRoomState(arg1 context.Context, arg2 string) error {
func (fake *FakeRouter) ClearRoomState(arg1 context.Context, arg2 livekit.RoomName) error {
fake.clearRoomStateMutex.Lock()
ret, specificReturn := fake.clearRoomStateReturnsOnCall[len(fake.clearRoomStateArgsForCall)]
fake.clearRoomStateArgsForCall = append(fake.clearRoomStateArgsForCall, struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
}{arg1, arg2})
stub := fake.ClearRoomStateStub
fakeReturns := fake.clearRoomStateReturns
@@ -196,13 +196,13 @@ func (fake *FakeRouter) ClearRoomStateCallCount() int {
return len(fake.clearRoomStateArgsForCall)
}
func (fake *FakeRouter) ClearRoomStateCalls(stub func(context.Context, string) error) {
func (fake *FakeRouter) ClearRoomStateCalls(stub func(context.Context, livekit.RoomName) error) {
fake.clearRoomStateMutex.Lock()
defer fake.clearRoomStateMutex.Unlock()
fake.ClearRoomStateStub = stub
}
func (fake *FakeRouter) ClearRoomStateArgsForCall(i int) (context.Context, string) {
func (fake *FakeRouter) ClearRoomStateArgsForCall(i int) (context.Context, livekit.RoomName) {
fake.clearRoomStateMutex.RLock()
defer fake.clearRoomStateMutex.RUnlock()
argsForCall := fake.clearRoomStateArgsForCall[i]
@@ -256,12 +256,12 @@ func (fake *FakeRouter) DrainCalls(stub func()) {
fake.DrainStub = stub
}
func (fake *FakeRouter) GetNodeForRoom(arg1 context.Context, arg2 string) (*livekit.Node, error) {
func (fake *FakeRouter) GetNodeForRoom(arg1 context.Context, arg2 livekit.RoomName) (*livekit.Node, error) {
fake.getNodeForRoomMutex.Lock()
ret, specificReturn := fake.getNodeForRoomReturnsOnCall[len(fake.getNodeForRoomArgsForCall)]
fake.getNodeForRoomArgsForCall = append(fake.getNodeForRoomArgsForCall, struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
}{arg1, arg2})
stub := fake.GetNodeForRoomStub
fakeReturns := fake.getNodeForRoomReturns
@@ -282,13 +282,13 @@ func (fake *FakeRouter) GetNodeForRoomCallCount() int {
return len(fake.getNodeForRoomArgsForCall)
}
func (fake *FakeRouter) GetNodeForRoomCalls(stub func(context.Context, string) (*livekit.Node, error)) {
func (fake *FakeRouter) GetNodeForRoomCalls(stub func(context.Context, livekit.RoomName) (*livekit.Node, error)) {
fake.getNodeForRoomMutex.Lock()
defer fake.getNodeForRoomMutex.Unlock()
fake.GetNodeForRoomStub = stub
}
func (fake *FakeRouter) GetNodeForRoomArgsForCall(i int) (context.Context, string) {
func (fake *FakeRouter) GetNodeForRoomArgsForCall(i int) (context.Context, livekit.RoomName) {
fake.getNodeForRoomMutex.RLock()
defer fake.getNodeForRoomMutex.RUnlock()
argsForCall := fake.getNodeForRoomArgsForCall[i]
@@ -547,12 +547,12 @@ func (fake *FakeRouter) RemoveDeadNodesReturnsOnCall(i int, result1 error) {
}{result1}
}
func (fake *FakeRouter) SetNodeForRoom(arg1 context.Context, arg2 string, arg3 string) error {
func (fake *FakeRouter) SetNodeForRoom(arg1 context.Context, arg2 livekit.RoomName, arg3 string) error {
fake.setNodeForRoomMutex.Lock()
ret, specificReturn := fake.setNodeForRoomReturnsOnCall[len(fake.setNodeForRoomArgsForCall)]
fake.setNodeForRoomArgsForCall = append(fake.setNodeForRoomArgsForCall, struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 string
}{arg1, arg2, arg3})
stub := fake.SetNodeForRoomStub
@@ -574,13 +574,13 @@ func (fake *FakeRouter) SetNodeForRoomCallCount() int {
return len(fake.setNodeForRoomArgsForCall)
}
func (fake *FakeRouter) SetNodeForRoomCalls(stub func(context.Context, string, string) error) {
func (fake *FakeRouter) SetNodeForRoomCalls(stub func(context.Context, livekit.RoomName, string) error) {
fake.setNodeForRoomMutex.Lock()
defer fake.setNodeForRoomMutex.Unlock()
fake.SetNodeForRoomStub = stub
}
func (fake *FakeRouter) SetNodeForRoomArgsForCall(i int) (context.Context, string, string) {
func (fake *FakeRouter) SetNodeForRoomArgsForCall(i int) (context.Context, livekit.RoomName, string) {
fake.setNodeForRoomMutex.RLock()
defer fake.setNodeForRoomMutex.RUnlock()
argsForCall := fake.setNodeForRoomArgsForCall[i]
@@ -663,12 +663,12 @@ func (fake *FakeRouter) StartReturnsOnCall(i int, result1 error) {
}{result1}
}
func (fake *FakeRouter) StartParticipantSignal(arg1 context.Context, arg2 string, arg3 routing.ParticipantInit) (string, routing.MessageSink, routing.MessageSource, error) {
func (fake *FakeRouter) StartParticipantSignal(arg1 context.Context, arg2 livekit.RoomName, arg3 routing.ParticipantInit) (string, routing.MessageSink, routing.MessageSource, error) {
fake.startParticipantSignalMutex.Lock()
ret, specificReturn := fake.startParticipantSignalReturnsOnCall[len(fake.startParticipantSignalArgsForCall)]
fake.startParticipantSignalArgsForCall = append(fake.startParticipantSignalArgsForCall, struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 routing.ParticipantInit
}{arg1, arg2, arg3})
stub := fake.StartParticipantSignalStub
@@ -690,13 +690,13 @@ func (fake *FakeRouter) StartParticipantSignalCallCount() int {
return len(fake.startParticipantSignalArgsForCall)
}
func (fake *FakeRouter) StartParticipantSignalCalls(stub func(context.Context, string, routing.ParticipantInit) (string, routing.MessageSink, routing.MessageSource, error)) {
func (fake *FakeRouter) StartParticipantSignalCalls(stub func(context.Context, livekit.RoomName, routing.ParticipantInit) (string, routing.MessageSink, routing.MessageSource, error)) {
fake.startParticipantSignalMutex.Lock()
defer fake.startParticipantSignalMutex.Unlock()
fake.StartParticipantSignalStub = stub
}
func (fake *FakeRouter) StartParticipantSignalArgsForCall(i int) (context.Context, string, routing.ParticipantInit) {
func (fake *FakeRouter) StartParticipantSignalArgsForCall(i int) (context.Context, livekit.RoomName, routing.ParticipantInit) {
fake.startParticipantSignalMutex.RLock()
defer fake.startParticipantSignalMutex.RUnlock()
argsForCall := fake.startParticipantSignalArgsForCall[i]
@@ -812,12 +812,12 @@ func (fake *FakeRouter) UnregisterNodeReturnsOnCall(i int, result1 error) {
}{result1}
}
func (fake *FakeRouter) WriteParticipantRTC(arg1 context.Context, arg2 string, arg3 string, arg4 *livekit.RTCNodeMessage) error {
func (fake *FakeRouter) WriteParticipantRTC(arg1 context.Context, arg2 livekit.RoomName, arg3 string, arg4 *livekit.RTCNodeMessage) error {
fake.writeParticipantRTCMutex.Lock()
ret, specificReturn := fake.writeParticipantRTCReturnsOnCall[len(fake.writeParticipantRTCArgsForCall)]
fake.writeParticipantRTCArgsForCall = append(fake.writeParticipantRTCArgsForCall, struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 string
arg4 *livekit.RTCNodeMessage
}{arg1, arg2, arg3, arg4})
@@ -840,13 +840,13 @@ func (fake *FakeRouter) WriteParticipantRTCCallCount() int {
return len(fake.writeParticipantRTCArgsForCall)
}
func (fake *FakeRouter) WriteParticipantRTCCalls(stub func(context.Context, string, string, *livekit.RTCNodeMessage) error) {
func (fake *FakeRouter) WriteParticipantRTCCalls(stub func(context.Context, livekit.RoomName, string, *livekit.RTCNodeMessage) error) {
fake.writeParticipantRTCMutex.Lock()
defer fake.writeParticipantRTCMutex.Unlock()
fake.WriteParticipantRTCStub = stub
}
func (fake *FakeRouter) WriteParticipantRTCArgsForCall(i int) (context.Context, string, string, *livekit.RTCNodeMessage) {
func (fake *FakeRouter) WriteParticipantRTCArgsForCall(i int) (context.Context, livekit.RoomName, string, *livekit.RTCNodeMessage) {
fake.writeParticipantRTCMutex.RLock()
defer fake.writeParticipantRTCMutex.RUnlock()
argsForCall := fake.writeParticipantRTCArgsForCall[i]
@@ -876,12 +876,12 @@ func (fake *FakeRouter) WriteParticipantRTCReturnsOnCall(i int, result1 error) {
}{result1}
}
func (fake *FakeRouter) WriteRoomRTC(arg1 context.Context, arg2 string, arg3 string, arg4 *livekit.RTCNodeMessage) error {
func (fake *FakeRouter) WriteRoomRTC(arg1 context.Context, arg2 livekit.RoomName, arg3 string, arg4 *livekit.RTCNodeMessage) error {
fake.writeRoomRTCMutex.Lock()
ret, specificReturn := fake.writeRoomRTCReturnsOnCall[len(fake.writeRoomRTCArgsForCall)]
fake.writeRoomRTCArgsForCall = append(fake.writeRoomRTCArgsForCall, struct {
arg1 context.Context
arg2 string
arg2 livekit.RoomName
arg3 string
arg4 *livekit.RTCNodeMessage
}{arg1, arg2, arg3, arg4})
@@ -904,13 +904,13 @@ func (fake *FakeRouter) WriteRoomRTCCallCount() int {
return len(fake.writeRoomRTCArgsForCall)
}
func (fake *FakeRouter) WriteRoomRTCCalls(stub func(context.Context, string, string, *livekit.RTCNodeMessage) error) {
func (fake *FakeRouter) WriteRoomRTCCalls(stub func(context.Context, livekit.RoomName, string, *livekit.RTCNodeMessage) error) {
fake.writeRoomRTCMutex.Lock()
defer fake.writeRoomRTCMutex.Unlock()
fake.WriteRoomRTCStub = stub
}
func (fake *FakeRouter) WriteRoomRTCArgsForCall(i int) (context.Context, string, string, *livekit.RTCNodeMessage) {
func (fake *FakeRouter) WriteRoomRTCArgsForCall(i int) (context.Context, livekit.RoomName, string, *livekit.RTCNodeMessage) {
fake.writeRoomRTCMutex.RLock()
defer fake.writeRoomRTCMutex.RUnlock()
argsForCall := fake.writeRoomRTCArgsForCall[i]