add convenience methods to participant (#3016)
* add convenience methods to participant * tidy
This commit is contained in:
@@ -370,6 +370,11 @@ func (p *ParticipantImpl) IsRecorder() bool {
|
|||||||
return grants.GetParticipantKind() == livekit.ParticipantInfo_EGRESS || grants.Video.Recorder
|
return grants.GetParticipantKind() == livekit.ParticipantInfo_EGRESS || grants.Video.Recorder
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *ParticipantImpl) IsAgent() bool {
|
||||||
|
grants := p.grants.Load()
|
||||||
|
return grants.GetParticipantKind() == livekit.ParticipantInfo_AGENT || grants.Video.Agent
|
||||||
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) IsDependent() bool {
|
func (p *ParticipantImpl) IsDependent() bool {
|
||||||
grants := p.grants.Load()
|
grants := p.grants.Load()
|
||||||
switch grants.GetParticipantKind() {
|
switch grants.GetParticipantKind() {
|
||||||
@@ -615,6 +620,10 @@ func (p *ParticipantImpl) CanSkipBroadcast() bool {
|
|||||||
return !p.requireBroadcast
|
return !p.requireBroadcast
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *ParticipantImpl) VersionNumber() uint32 {
|
||||||
|
return p.version.Load()
|
||||||
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) ToProtoWithVersion() (*livekit.ParticipantInfo, utils.TimedVersion) {
|
func (p *ParticipantImpl) ToProtoWithVersion() (*livekit.ParticipantInfo, utils.TimedVersion) {
|
||||||
if p.dirty.Load() {
|
if p.dirty.Load() {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
|
|||||||
@@ -257,8 +257,10 @@ type Participant interface {
|
|||||||
Kind() livekit.ParticipantInfo_Kind
|
Kind() livekit.ParticipantInfo_Kind
|
||||||
IsRecorder() bool
|
IsRecorder() bool
|
||||||
IsDependent() bool
|
IsDependent() bool
|
||||||
|
IsAgent() bool
|
||||||
|
|
||||||
CanSkipBroadcast() bool
|
CanSkipBroadcast() bool
|
||||||
|
VersionNumber() uint32
|
||||||
ToProto() *livekit.ParticipantInfo
|
ToProto() *livekit.ParticipantInfo
|
||||||
|
|
||||||
IsPublisher() bool
|
IsPublisher() bool
|
||||||
|
|||||||
@@ -509,6 +509,16 @@ type FakeLocalParticipant struct {
|
|||||||
identityReturnsOnCall map[int]struct {
|
identityReturnsOnCall map[int]struct {
|
||||||
result1 livekit.ParticipantIdentity
|
result1 livekit.ParticipantIdentity
|
||||||
}
|
}
|
||||||
|
IsAgentStub func() bool
|
||||||
|
isAgentMutex sync.RWMutex
|
||||||
|
isAgentArgsForCall []struct {
|
||||||
|
}
|
||||||
|
isAgentReturns struct {
|
||||||
|
result1 bool
|
||||||
|
}
|
||||||
|
isAgentReturnsOnCall map[int]struct {
|
||||||
|
result1 bool
|
||||||
|
}
|
||||||
IsClosedStub func() bool
|
IsClosedStub func() bool
|
||||||
isClosedMutex sync.RWMutex
|
isClosedMutex sync.RWMutex
|
||||||
isClosedArgsForCall []struct {
|
isClosedArgsForCall []struct {
|
||||||
@@ -1084,6 +1094,16 @@ type FakeLocalParticipant struct {
|
|||||||
arg1 livekit.ParticipantID
|
arg1 livekit.ParticipantID
|
||||||
arg2 uint32
|
arg2 uint32
|
||||||
}
|
}
|
||||||
|
VersionNumberStub func() uint32
|
||||||
|
versionNumberMutex sync.RWMutex
|
||||||
|
versionNumberArgsForCall []struct {
|
||||||
|
}
|
||||||
|
versionNumberReturns struct {
|
||||||
|
result1 uint32
|
||||||
|
}
|
||||||
|
versionNumberReturnsOnCall map[int]struct {
|
||||||
|
result1 uint32
|
||||||
|
}
|
||||||
WaitUntilSubscribedStub func(time.Duration) error
|
WaitUntilSubscribedStub func(time.Duration) error
|
||||||
waitUntilSubscribedMutex sync.RWMutex
|
waitUntilSubscribedMutex sync.RWMutex
|
||||||
waitUntilSubscribedArgsForCall []struct {
|
waitUntilSubscribedArgsForCall []struct {
|
||||||
@@ -3682,6 +3702,59 @@ func (fake *FakeLocalParticipant) IdentityReturnsOnCall(i int, result1 livekit.P
|
|||||||
}{result1}
|
}{result1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) IsAgent() bool {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
ret, specificReturn := fake.isAgentReturnsOnCall[len(fake.isAgentArgsForCall)]
|
||||||
|
fake.isAgentArgsForCall = append(fake.isAgentArgsForCall, struct {
|
||||||
|
}{})
|
||||||
|
stub := fake.IsAgentStub
|
||||||
|
fakeReturns := fake.isAgentReturns
|
||||||
|
fake.recordInvocation("IsAgent", []interface{}{})
|
||||||
|
fake.isAgentMutex.Unlock()
|
||||||
|
if stub != nil {
|
||||||
|
return stub()
|
||||||
|
}
|
||||||
|
if specificReturn {
|
||||||
|
return ret.result1
|
||||||
|
}
|
||||||
|
return fakeReturns.result1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) IsAgentCallCount() int {
|
||||||
|
fake.isAgentMutex.RLock()
|
||||||
|
defer fake.isAgentMutex.RUnlock()
|
||||||
|
return len(fake.isAgentArgsForCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) IsAgentCalls(stub func() bool) {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
defer fake.isAgentMutex.Unlock()
|
||||||
|
fake.IsAgentStub = stub
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) IsAgentReturns(result1 bool) {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
defer fake.isAgentMutex.Unlock()
|
||||||
|
fake.IsAgentStub = nil
|
||||||
|
fake.isAgentReturns = struct {
|
||||||
|
result1 bool
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) IsAgentReturnsOnCall(i int, result1 bool) {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
defer fake.isAgentMutex.Unlock()
|
||||||
|
fake.IsAgentStub = nil
|
||||||
|
if fake.isAgentReturnsOnCall == nil {
|
||||||
|
fake.isAgentReturnsOnCall = make(map[int]struct {
|
||||||
|
result1 bool
|
||||||
|
})
|
||||||
|
}
|
||||||
|
fake.isAgentReturnsOnCall[i] = struct {
|
||||||
|
result1 bool
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) IsClosed() bool {
|
func (fake *FakeLocalParticipant) IsClosed() bool {
|
||||||
fake.isClosedMutex.Lock()
|
fake.isClosedMutex.Lock()
|
||||||
ret, specificReturn := fake.isClosedReturnsOnCall[len(fake.isClosedArgsForCall)]
|
ret, specificReturn := fake.isClosedReturnsOnCall[len(fake.isClosedArgsForCall)]
|
||||||
@@ -6894,6 +6967,59 @@ func (fake *FakeLocalParticipant) VerifySubscribeParticipantInfoArgsForCall(i in
|
|||||||
return argsForCall.arg1, argsForCall.arg2
|
return argsForCall.arg1, argsForCall.arg2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) VersionNumber() uint32 {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
ret, specificReturn := fake.versionNumberReturnsOnCall[len(fake.versionNumberArgsForCall)]
|
||||||
|
fake.versionNumberArgsForCall = append(fake.versionNumberArgsForCall, struct {
|
||||||
|
}{})
|
||||||
|
stub := fake.VersionNumberStub
|
||||||
|
fakeReturns := fake.versionNumberReturns
|
||||||
|
fake.recordInvocation("VersionNumber", []interface{}{})
|
||||||
|
fake.versionNumberMutex.Unlock()
|
||||||
|
if stub != nil {
|
||||||
|
return stub()
|
||||||
|
}
|
||||||
|
if specificReturn {
|
||||||
|
return ret.result1
|
||||||
|
}
|
||||||
|
return fakeReturns.result1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) VersionNumberCallCount() int {
|
||||||
|
fake.versionNumberMutex.RLock()
|
||||||
|
defer fake.versionNumberMutex.RUnlock()
|
||||||
|
return len(fake.versionNumberArgsForCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) VersionNumberCalls(stub func() uint32) {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
defer fake.versionNumberMutex.Unlock()
|
||||||
|
fake.VersionNumberStub = stub
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) VersionNumberReturns(result1 uint32) {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
defer fake.versionNumberMutex.Unlock()
|
||||||
|
fake.VersionNumberStub = nil
|
||||||
|
fake.versionNumberReturns = struct {
|
||||||
|
result1 uint32
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) VersionNumberReturnsOnCall(i int, result1 uint32) {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
defer fake.versionNumberMutex.Unlock()
|
||||||
|
fake.VersionNumberStub = nil
|
||||||
|
if fake.versionNumberReturnsOnCall == nil {
|
||||||
|
fake.versionNumberReturnsOnCall = make(map[int]struct {
|
||||||
|
result1 uint32
|
||||||
|
})
|
||||||
|
}
|
||||||
|
fake.versionNumberReturnsOnCall[i] = struct {
|
||||||
|
result1 uint32
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) WaitUntilSubscribed(arg1 time.Duration) error {
|
func (fake *FakeLocalParticipant) WaitUntilSubscribed(arg1 time.Duration) error {
|
||||||
fake.waitUntilSubscribedMutex.Lock()
|
fake.waitUntilSubscribedMutex.Lock()
|
||||||
ret, specificReturn := fake.waitUntilSubscribedReturnsOnCall[len(fake.waitUntilSubscribedArgsForCall)]
|
ret, specificReturn := fake.waitUntilSubscribedReturnsOnCall[len(fake.waitUntilSubscribedArgsForCall)]
|
||||||
@@ -7124,6 +7250,8 @@ func (fake *FakeLocalParticipant) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.iDMutex.RUnlock()
|
defer fake.iDMutex.RUnlock()
|
||||||
fake.identityMutex.RLock()
|
fake.identityMutex.RLock()
|
||||||
defer fake.identityMutex.RUnlock()
|
defer fake.identityMutex.RUnlock()
|
||||||
|
fake.isAgentMutex.RLock()
|
||||||
|
defer fake.isAgentMutex.RUnlock()
|
||||||
fake.isClosedMutex.RLock()
|
fake.isClosedMutex.RLock()
|
||||||
defer fake.isClosedMutex.RUnlock()
|
defer fake.isClosedMutex.RUnlock()
|
||||||
fake.isDependentMutex.RLock()
|
fake.isDependentMutex.RLock()
|
||||||
@@ -7266,6 +7394,8 @@ func (fake *FakeLocalParticipant) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.updateVideoTrackMutex.RUnlock()
|
defer fake.updateVideoTrackMutex.RUnlock()
|
||||||
fake.verifySubscribeParticipantInfoMutex.RLock()
|
fake.verifySubscribeParticipantInfoMutex.RLock()
|
||||||
defer fake.verifySubscribeParticipantInfoMutex.RUnlock()
|
defer fake.verifySubscribeParticipantInfoMutex.RUnlock()
|
||||||
|
fake.versionNumberMutex.RLock()
|
||||||
|
defer fake.versionNumberMutex.RUnlock()
|
||||||
fake.waitUntilSubscribedMutex.RLock()
|
fake.waitUntilSubscribedMutex.RLock()
|
||||||
defer fake.waitUntilSubscribedMutex.RUnlock()
|
defer fake.waitUntilSubscribedMutex.RUnlock()
|
||||||
fake.writeSubscriberRTCPMutex.RLock()
|
fake.writeSubscriberRTCPMutex.RLock()
|
||||||
|
|||||||
@@ -128,6 +128,16 @@ type FakeParticipant struct {
|
|||||||
identityReturnsOnCall map[int]struct {
|
identityReturnsOnCall map[int]struct {
|
||||||
result1 livekit.ParticipantIdentity
|
result1 livekit.ParticipantIdentity
|
||||||
}
|
}
|
||||||
|
IsAgentStub func() bool
|
||||||
|
isAgentMutex sync.RWMutex
|
||||||
|
isAgentArgsForCall []struct {
|
||||||
|
}
|
||||||
|
isAgentReturns struct {
|
||||||
|
result1 bool
|
||||||
|
}
|
||||||
|
isAgentReturnsOnCall map[int]struct {
|
||||||
|
result1 bool
|
||||||
|
}
|
||||||
IsDependentStub func() bool
|
IsDependentStub func() bool
|
||||||
isDependentMutex sync.RWMutex
|
isDependentMutex sync.RWMutex
|
||||||
isDependentArgsForCall []struct {
|
isDependentArgsForCall []struct {
|
||||||
@@ -220,6 +230,16 @@ type FakeParticipant struct {
|
|||||||
updateSubscriptionPermissionReturnsOnCall map[int]struct {
|
updateSubscriptionPermissionReturnsOnCall map[int]struct {
|
||||||
result1 error
|
result1 error
|
||||||
}
|
}
|
||||||
|
VersionNumberStub func() uint32
|
||||||
|
versionNumberMutex sync.RWMutex
|
||||||
|
versionNumberArgsForCall []struct {
|
||||||
|
}
|
||||||
|
versionNumberReturns struct {
|
||||||
|
result1 uint32
|
||||||
|
}
|
||||||
|
versionNumberReturnsOnCall map[int]struct {
|
||||||
|
result1 uint32
|
||||||
|
}
|
||||||
invocations map[string][][]interface{}
|
invocations map[string][][]interface{}
|
||||||
invocationsMutex sync.RWMutex
|
invocationsMutex sync.RWMutex
|
||||||
}
|
}
|
||||||
@@ -837,6 +857,59 @@ func (fake *FakeParticipant) IdentityReturnsOnCall(i int, result1 livekit.Partic
|
|||||||
}{result1}
|
}{result1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) IsAgent() bool {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
ret, specificReturn := fake.isAgentReturnsOnCall[len(fake.isAgentArgsForCall)]
|
||||||
|
fake.isAgentArgsForCall = append(fake.isAgentArgsForCall, struct {
|
||||||
|
}{})
|
||||||
|
stub := fake.IsAgentStub
|
||||||
|
fakeReturns := fake.isAgentReturns
|
||||||
|
fake.recordInvocation("IsAgent", []interface{}{})
|
||||||
|
fake.isAgentMutex.Unlock()
|
||||||
|
if stub != nil {
|
||||||
|
return stub()
|
||||||
|
}
|
||||||
|
if specificReturn {
|
||||||
|
return ret.result1
|
||||||
|
}
|
||||||
|
return fakeReturns.result1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) IsAgentCallCount() int {
|
||||||
|
fake.isAgentMutex.RLock()
|
||||||
|
defer fake.isAgentMutex.RUnlock()
|
||||||
|
return len(fake.isAgentArgsForCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) IsAgentCalls(stub func() bool) {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
defer fake.isAgentMutex.Unlock()
|
||||||
|
fake.IsAgentStub = stub
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) IsAgentReturns(result1 bool) {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
defer fake.isAgentMutex.Unlock()
|
||||||
|
fake.IsAgentStub = nil
|
||||||
|
fake.isAgentReturns = struct {
|
||||||
|
result1 bool
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) IsAgentReturnsOnCall(i int, result1 bool) {
|
||||||
|
fake.isAgentMutex.Lock()
|
||||||
|
defer fake.isAgentMutex.Unlock()
|
||||||
|
fake.IsAgentStub = nil
|
||||||
|
if fake.isAgentReturnsOnCall == nil {
|
||||||
|
fake.isAgentReturnsOnCall = make(map[int]struct {
|
||||||
|
result1 bool
|
||||||
|
})
|
||||||
|
}
|
||||||
|
fake.isAgentReturnsOnCall[i] = struct {
|
||||||
|
result1 bool
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
func (fake *FakeParticipant) IsDependent() bool {
|
func (fake *FakeParticipant) IsDependent() bool {
|
||||||
fake.isDependentMutex.Lock()
|
fake.isDependentMutex.Lock()
|
||||||
ret, specificReturn := fake.isDependentReturnsOnCall[len(fake.isDependentArgsForCall)]
|
ret, specificReturn := fake.isDependentReturnsOnCall[len(fake.isDependentArgsForCall)]
|
||||||
@@ -1308,6 +1381,59 @@ func (fake *FakeParticipant) UpdateSubscriptionPermissionReturnsOnCall(i int, re
|
|||||||
}{result1}
|
}{result1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) VersionNumber() uint32 {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
ret, specificReturn := fake.versionNumberReturnsOnCall[len(fake.versionNumberArgsForCall)]
|
||||||
|
fake.versionNumberArgsForCall = append(fake.versionNumberArgsForCall, struct {
|
||||||
|
}{})
|
||||||
|
stub := fake.VersionNumberStub
|
||||||
|
fakeReturns := fake.versionNumberReturns
|
||||||
|
fake.recordInvocation("VersionNumber", []interface{}{})
|
||||||
|
fake.versionNumberMutex.Unlock()
|
||||||
|
if stub != nil {
|
||||||
|
return stub()
|
||||||
|
}
|
||||||
|
if specificReturn {
|
||||||
|
return ret.result1
|
||||||
|
}
|
||||||
|
return fakeReturns.result1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) VersionNumberCallCount() int {
|
||||||
|
fake.versionNumberMutex.RLock()
|
||||||
|
defer fake.versionNumberMutex.RUnlock()
|
||||||
|
return len(fake.versionNumberArgsForCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) VersionNumberCalls(stub func() uint32) {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
defer fake.versionNumberMutex.Unlock()
|
||||||
|
fake.VersionNumberStub = stub
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) VersionNumberReturns(result1 uint32) {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
defer fake.versionNumberMutex.Unlock()
|
||||||
|
fake.VersionNumberStub = nil
|
||||||
|
fake.versionNumberReturns = struct {
|
||||||
|
result1 uint32
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) VersionNumberReturnsOnCall(i int, result1 uint32) {
|
||||||
|
fake.versionNumberMutex.Lock()
|
||||||
|
defer fake.versionNumberMutex.Unlock()
|
||||||
|
fake.VersionNumberStub = nil
|
||||||
|
if fake.versionNumberReturnsOnCall == nil {
|
||||||
|
fake.versionNumberReturnsOnCall = make(map[int]struct {
|
||||||
|
result1 uint32
|
||||||
|
})
|
||||||
|
}
|
||||||
|
fake.versionNumberReturnsOnCall[i] = struct {
|
||||||
|
result1 uint32
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
|
func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
|
||||||
fake.invocationsMutex.RLock()
|
fake.invocationsMutex.RLock()
|
||||||
defer fake.invocationsMutex.RUnlock()
|
defer fake.invocationsMutex.RUnlock()
|
||||||
@@ -1333,6 +1459,8 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.iDMutex.RUnlock()
|
defer fake.iDMutex.RUnlock()
|
||||||
fake.identityMutex.RLock()
|
fake.identityMutex.RLock()
|
||||||
defer fake.identityMutex.RUnlock()
|
defer fake.identityMutex.RUnlock()
|
||||||
|
fake.isAgentMutex.RLock()
|
||||||
|
defer fake.isAgentMutex.RUnlock()
|
||||||
fake.isDependentMutex.RLock()
|
fake.isDependentMutex.RLock()
|
||||||
defer fake.isDependentMutex.RUnlock()
|
defer fake.isDependentMutex.RUnlock()
|
||||||
fake.isPublisherMutex.RLock()
|
fake.isPublisherMutex.RLock()
|
||||||
@@ -1351,6 +1479,8 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.toProtoMutex.RUnlock()
|
defer fake.toProtoMutex.RUnlock()
|
||||||
fake.updateSubscriptionPermissionMutex.RLock()
|
fake.updateSubscriptionPermissionMutex.RLock()
|
||||||
defer fake.updateSubscriptionPermissionMutex.RUnlock()
|
defer fake.updateSubscriptionPermissionMutex.RUnlock()
|
||||||
|
fake.versionNumberMutex.RLock()
|
||||||
|
defer fake.versionNumberMutex.RUnlock()
|
||||||
copiedInvocations := map[string][][]interface{}{}
|
copiedInvocations := map[string][][]interface{}{}
|
||||||
for key, value := range fake.invocations {
|
for key, value := range fake.invocations {
|
||||||
copiedInvocations[key] = value
|
copiedInvocations[key] = value
|
||||||
|
|||||||
@@ -33,6 +33,17 @@ type FakeWebsocketClient struct {
|
|||||||
result2 []byte
|
result2 []byte
|
||||||
result3 error
|
result3 error
|
||||||
}
|
}
|
||||||
|
SetReadDeadlineStub func(time.Time) error
|
||||||
|
setReadDeadlineMutex sync.RWMutex
|
||||||
|
setReadDeadlineArgsForCall []struct {
|
||||||
|
arg1 time.Time
|
||||||
|
}
|
||||||
|
setReadDeadlineReturns struct {
|
||||||
|
result1 error
|
||||||
|
}
|
||||||
|
setReadDeadlineReturnsOnCall map[int]struct {
|
||||||
|
result1 error
|
||||||
|
}
|
||||||
WriteControlStub func(int, []byte, time.Time) error
|
WriteControlStub func(int, []byte, time.Time) error
|
||||||
writeControlMutex sync.RWMutex
|
writeControlMutex sync.RWMutex
|
||||||
writeControlArgsForCall []struct {
|
writeControlArgsForCall []struct {
|
||||||
@@ -174,6 +185,67 @@ func (fake *FakeWebsocketClient) ReadMessageReturnsOnCall(i int, result1 int, re
|
|||||||
}{result1, result2, result3}
|
}{result1, result2, result3}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fake *FakeWebsocketClient) SetReadDeadline(arg1 time.Time) error {
|
||||||
|
fake.setReadDeadlineMutex.Lock()
|
||||||
|
ret, specificReturn := fake.setReadDeadlineReturnsOnCall[len(fake.setReadDeadlineArgsForCall)]
|
||||||
|
fake.setReadDeadlineArgsForCall = append(fake.setReadDeadlineArgsForCall, struct {
|
||||||
|
arg1 time.Time
|
||||||
|
}{arg1})
|
||||||
|
stub := fake.SetReadDeadlineStub
|
||||||
|
fakeReturns := fake.setReadDeadlineReturns
|
||||||
|
fake.recordInvocation("SetReadDeadline", []interface{}{arg1})
|
||||||
|
fake.setReadDeadlineMutex.Unlock()
|
||||||
|
if stub != nil {
|
||||||
|
return stub(arg1)
|
||||||
|
}
|
||||||
|
if specificReturn {
|
||||||
|
return ret.result1
|
||||||
|
}
|
||||||
|
return fakeReturns.result1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeWebsocketClient) SetReadDeadlineCallCount() int {
|
||||||
|
fake.setReadDeadlineMutex.RLock()
|
||||||
|
defer fake.setReadDeadlineMutex.RUnlock()
|
||||||
|
return len(fake.setReadDeadlineArgsForCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeWebsocketClient) SetReadDeadlineCalls(stub func(time.Time) error) {
|
||||||
|
fake.setReadDeadlineMutex.Lock()
|
||||||
|
defer fake.setReadDeadlineMutex.Unlock()
|
||||||
|
fake.SetReadDeadlineStub = stub
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeWebsocketClient) SetReadDeadlineArgsForCall(i int) time.Time {
|
||||||
|
fake.setReadDeadlineMutex.RLock()
|
||||||
|
defer fake.setReadDeadlineMutex.RUnlock()
|
||||||
|
argsForCall := fake.setReadDeadlineArgsForCall[i]
|
||||||
|
return argsForCall.arg1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeWebsocketClient) SetReadDeadlineReturns(result1 error) {
|
||||||
|
fake.setReadDeadlineMutex.Lock()
|
||||||
|
defer fake.setReadDeadlineMutex.Unlock()
|
||||||
|
fake.SetReadDeadlineStub = nil
|
||||||
|
fake.setReadDeadlineReturns = struct {
|
||||||
|
result1 error
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeWebsocketClient) SetReadDeadlineReturnsOnCall(i int, result1 error) {
|
||||||
|
fake.setReadDeadlineMutex.Lock()
|
||||||
|
defer fake.setReadDeadlineMutex.Unlock()
|
||||||
|
fake.SetReadDeadlineStub = nil
|
||||||
|
if fake.setReadDeadlineReturnsOnCall == nil {
|
||||||
|
fake.setReadDeadlineReturnsOnCall = make(map[int]struct {
|
||||||
|
result1 error
|
||||||
|
})
|
||||||
|
}
|
||||||
|
fake.setReadDeadlineReturnsOnCall[i] = struct {
|
||||||
|
result1 error
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
func (fake *FakeWebsocketClient) WriteControl(arg1 int, arg2 []byte, arg3 time.Time) error {
|
func (fake *FakeWebsocketClient) WriteControl(arg1 int, arg2 []byte, arg3 time.Time) error {
|
||||||
var arg2Copy []byte
|
var arg2Copy []byte
|
||||||
if arg2 != nil {
|
if arg2 != nil {
|
||||||
@@ -316,6 +388,8 @@ func (fake *FakeWebsocketClient) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.closeMutex.RUnlock()
|
defer fake.closeMutex.RUnlock()
|
||||||
fake.readMessageMutex.RLock()
|
fake.readMessageMutex.RLock()
|
||||||
defer fake.readMessageMutex.RUnlock()
|
defer fake.readMessageMutex.RUnlock()
|
||||||
|
fake.setReadDeadlineMutex.RLock()
|
||||||
|
defer fake.setReadDeadlineMutex.RUnlock()
|
||||||
fake.writeControlMutex.RLock()
|
fake.writeControlMutex.RLock()
|
||||||
defer fake.writeControlMutex.RUnlock()
|
defer fake.writeControlMutex.RUnlock()
|
||||||
fake.writeMessageMutex.RLock()
|
fake.writeMessageMutex.RLock()
|
||||||
|
|||||||
Reference in New Issue
Block a user