mirror of
https://github.com/livekit/livekit.git
synced 2026-04-27 10:45:23 +00:00
104 lines
2.9 KiB
Go
104 lines
2.9 KiB
Go
// Code generated by counterfeiter. DO NOT EDIT.
|
|
package routingfakes
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/livekit/livekit-server/pkg/routing"
|
|
"google.golang.org/protobuf/reflect/protoreflect"
|
|
)
|
|
|
|
type FakeMessageSource struct {
|
|
ReadChanStub func() <-chan protoreflect.ProtoMessage
|
|
readChanMutex sync.RWMutex
|
|
readChanArgsForCall []struct {
|
|
}
|
|
readChanReturns struct {
|
|
result1 <-chan protoreflect.ProtoMessage
|
|
}
|
|
readChanReturnsOnCall map[int]struct {
|
|
result1 <-chan protoreflect.ProtoMessage
|
|
}
|
|
invocations map[string][][]interface{}
|
|
invocationsMutex sync.RWMutex
|
|
}
|
|
|
|
func (fake *FakeMessageSource) ReadChan() <-chan protoreflect.ProtoMessage {
|
|
fake.readChanMutex.Lock()
|
|
ret, specificReturn := fake.readChanReturnsOnCall[len(fake.readChanArgsForCall)]
|
|
fake.readChanArgsForCall = append(fake.readChanArgsForCall, struct {
|
|
}{})
|
|
stub := fake.ReadChanStub
|
|
fakeReturns := fake.readChanReturns
|
|
fake.recordInvocation("ReadChan", []interface{}{})
|
|
fake.readChanMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *FakeMessageSource) ReadChanCallCount() int {
|
|
fake.readChanMutex.RLock()
|
|
defer fake.readChanMutex.RUnlock()
|
|
return len(fake.readChanArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeMessageSource) ReadChanCalls(stub func() <-chan protoreflect.ProtoMessage) {
|
|
fake.readChanMutex.Lock()
|
|
defer fake.readChanMutex.Unlock()
|
|
fake.ReadChanStub = stub
|
|
}
|
|
|
|
func (fake *FakeMessageSource) ReadChanReturns(result1 <-chan protoreflect.ProtoMessage) {
|
|
fake.readChanMutex.Lock()
|
|
defer fake.readChanMutex.Unlock()
|
|
fake.ReadChanStub = nil
|
|
fake.readChanReturns = struct {
|
|
result1 <-chan protoreflect.ProtoMessage
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeMessageSource) ReadChanReturnsOnCall(i int, result1 <-chan protoreflect.ProtoMessage) {
|
|
fake.readChanMutex.Lock()
|
|
defer fake.readChanMutex.Unlock()
|
|
fake.ReadChanStub = nil
|
|
if fake.readChanReturnsOnCall == nil {
|
|
fake.readChanReturnsOnCall = make(map[int]struct {
|
|
result1 <-chan protoreflect.ProtoMessage
|
|
})
|
|
}
|
|
fake.readChanReturnsOnCall[i] = struct {
|
|
result1 <-chan protoreflect.ProtoMessage
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeMessageSource) Invocations() map[string][][]interface{} {
|
|
fake.invocationsMutex.RLock()
|
|
defer fake.invocationsMutex.RUnlock()
|
|
fake.readChanMutex.RLock()
|
|
defer fake.readChanMutex.RUnlock()
|
|
copiedInvocations := map[string][][]interface{}{}
|
|
for key, value := range fake.invocations {
|
|
copiedInvocations[key] = value
|
|
}
|
|
return copiedInvocations
|
|
}
|
|
|
|
func (fake *FakeMessageSource) recordInvocation(key string, args []interface{}) {
|
|
fake.invocationsMutex.Lock()
|
|
defer fake.invocationsMutex.Unlock()
|
|
if fake.invocations == nil {
|
|
fake.invocations = map[string][][]interface{}{}
|
|
}
|
|
if fake.invocations[key] == nil {
|
|
fake.invocations[key] = [][]interface{}{}
|
|
}
|
|
fake.invocations[key] = append(fake.invocations[key], args)
|
|
}
|
|
|
|
var _ routing.MessageSource = new(FakeMessageSource)
|