move delete to oss service store (#4164)

This commit is contained in:
Paul Wells
2025-12-16 22:00:43 -08:00
committed by GitHub
parent 5964efbba5
commit 3e41725395
4 changed files with 86 additions and 76 deletions
@@ -36,6 +36,21 @@ type FakeObjectStore struct {
deleteRoomReturnsOnCall map[int]struct {
result1 error
}
HasParticipantStub func(context.Context, livekit.RoomName, livekit.ParticipantIdentity) (bool, error)
hasParticipantMutex sync.RWMutex
hasParticipantArgsForCall []struct {
arg1 context.Context
arg2 livekit.RoomName
arg3 livekit.ParticipantIdentity
}
hasParticipantReturns struct {
result1 bool
result2 error
}
hasParticipantReturnsOnCall map[int]struct {
result1 bool
result2 error
}
ListParticipantsStub func(context.Context, livekit.RoomName) ([]*livekit.ParticipantInfo, error)
listParticipantsMutex sync.RWMutex
listParticipantsArgsForCall []struct {
@@ -279,6 +294,72 @@ func (fake *FakeObjectStore) DeleteRoomReturnsOnCall(i int, result1 error) {
}{result1}
}
func (fake *FakeObjectStore) HasParticipant(arg1 context.Context, arg2 livekit.RoomName, arg3 livekit.ParticipantIdentity) (bool, error) {
fake.hasParticipantMutex.Lock()
ret, specificReturn := fake.hasParticipantReturnsOnCall[len(fake.hasParticipantArgsForCall)]
fake.hasParticipantArgsForCall = append(fake.hasParticipantArgsForCall, struct {
arg1 context.Context
arg2 livekit.RoomName
arg3 livekit.ParticipantIdentity
}{arg1, arg2, arg3})
stub := fake.HasParticipantStub
fakeReturns := fake.hasParticipantReturns
fake.recordInvocation("HasParticipant", []interface{}{arg1, arg2, arg3})
fake.hasParticipantMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeObjectStore) HasParticipantCallCount() int {
fake.hasParticipantMutex.RLock()
defer fake.hasParticipantMutex.RUnlock()
return len(fake.hasParticipantArgsForCall)
}
func (fake *FakeObjectStore) HasParticipantCalls(stub func(context.Context, livekit.RoomName, livekit.ParticipantIdentity) (bool, error)) {
fake.hasParticipantMutex.Lock()
defer fake.hasParticipantMutex.Unlock()
fake.HasParticipantStub = stub
}
func (fake *FakeObjectStore) HasParticipantArgsForCall(i int) (context.Context, livekit.RoomName, livekit.ParticipantIdentity) {
fake.hasParticipantMutex.RLock()
defer fake.hasParticipantMutex.RUnlock()
argsForCall := fake.hasParticipantArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *FakeObjectStore) HasParticipantReturns(result1 bool, result2 error) {
fake.hasParticipantMutex.Lock()
defer fake.hasParticipantMutex.Unlock()
fake.HasParticipantStub = nil
fake.hasParticipantReturns = struct {
result1 bool
result2 error
}{result1, result2}
}
func (fake *FakeObjectStore) HasParticipantReturnsOnCall(i int, result1 bool, result2 error) {
fake.hasParticipantMutex.Lock()
defer fake.hasParticipantMutex.Unlock()
fake.HasParticipantStub = nil
if fake.hasParticipantReturnsOnCall == nil {
fake.hasParticipantReturnsOnCall = make(map[int]struct {
result1 bool
result2 error
})
}
fake.hasParticipantReturnsOnCall[i] = struct {
result1 bool
result2 error
}{result1, result2}
}
func (fake *FakeObjectStore) ListParticipants(arg1 context.Context, arg2 livekit.RoomName) ([]*livekit.ParticipantInfo, error) {
fake.listParticipantsMutex.Lock()
ret, specificReturn := fake.listParticipantsReturnsOnCall[len(fake.listParticipantsArgsForCall)]
@@ -10,18 +10,6 @@ import (
)
type FakeServiceStore struct {
DeleteRoomStub func(context.Context, livekit.RoomName) error
deleteRoomMutex sync.RWMutex
deleteRoomArgsForCall []struct {
arg1 context.Context
arg2 livekit.RoomName
}
deleteRoomReturns struct {
result1 error
}
deleteRoomReturnsOnCall map[int]struct {
result1 error
}
ListParticipantsStub func(context.Context, livekit.RoomName) ([]*livekit.ParticipantInfo, error)
listParticipantsMutex sync.RWMutex
listParticipantsArgsForCall []struct {
@@ -86,68 +74,6 @@ type FakeServiceStore struct {
invocationsMutex sync.RWMutex
}
func (fake *FakeServiceStore) DeleteRoom(arg1 context.Context, arg2 livekit.RoomName) error {
fake.deleteRoomMutex.Lock()
ret, specificReturn := fake.deleteRoomReturnsOnCall[len(fake.deleteRoomArgsForCall)]
fake.deleteRoomArgsForCall = append(fake.deleteRoomArgsForCall, struct {
arg1 context.Context
arg2 livekit.RoomName
}{arg1, arg2})
stub := fake.DeleteRoomStub
fakeReturns := fake.deleteRoomReturns
fake.recordInvocation("DeleteRoom", []interface{}{arg1, arg2})
fake.deleteRoomMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeServiceStore) DeleteRoomCallCount() int {
fake.deleteRoomMutex.RLock()
defer fake.deleteRoomMutex.RUnlock()
return len(fake.deleteRoomArgsForCall)
}
func (fake *FakeServiceStore) DeleteRoomCalls(stub func(context.Context, livekit.RoomName) error) {
fake.deleteRoomMutex.Lock()
defer fake.deleteRoomMutex.Unlock()
fake.DeleteRoomStub = stub
}
func (fake *FakeServiceStore) DeleteRoomArgsForCall(i int) (context.Context, livekit.RoomName) {
fake.deleteRoomMutex.RLock()
defer fake.deleteRoomMutex.RUnlock()
argsForCall := fake.deleteRoomArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeServiceStore) DeleteRoomReturns(result1 error) {
fake.deleteRoomMutex.Lock()
defer fake.deleteRoomMutex.Unlock()
fake.DeleteRoomStub = nil
fake.deleteRoomReturns = struct {
result1 error
}{result1}
}
func (fake *FakeServiceStore) DeleteRoomReturnsOnCall(i int, result1 error) {
fake.deleteRoomMutex.Lock()
defer fake.deleteRoomMutex.Unlock()
fake.DeleteRoomStub = nil
if fake.deleteRoomReturnsOnCall == nil {
fake.deleteRoomReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.deleteRoomReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeServiceStore) ListParticipants(arg1 context.Context, arg2 livekit.RoomName) ([]*livekit.ParticipantInfo, error) {
fake.listParticipantsMutex.Lock()
ret, specificReturn := fake.listParticipantsReturnsOnCall[len(fake.listParticipantsArgsForCall)]