This PR refactors the Go proxy server internals and significantly
expands RTMP/proxy verification coverage.
- Rename internal/protocol to internal/server to better describe the
package responsibility.
- Refactor proxy server constructors and types toward cleaner exported
interfaces:
- NewRTMPServer
- NewWebRTCServer
- NewHTTPAPIServer
- NewHTTPStreamServer
- NewSystemAPI
- Expose RTMP protocol interfaces for better testability:
- Handshake
- Protocol
- Message
- AMF0 public interfaces such as Amf0Any, Amf0Number, Amf0String,
Amf0Object, etc.
- Add RTMP unit tests covering AMF0, handshake, protocol messages,
packet encoding/decoding, and API examples.
- Add generated RTMP fakes for interface-based tests.
- Add proxy E2E scripts for:
- multi-origin memory load-balancer routing
- Redis multi-proxy routing
- RTMP transmuxing verification across RTMP, HTTP-FLV, HLS, and optional
WebRTC WHEP
- Update OpenClaw/SRSBot development docs and memory to reflect the new
package layout, new verification scripts, and unsupported origin/edge
development scope.
---------
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
555 lines
14 KiB
Go
555 lines
14 KiB
Go
// Code generated by counterfeiter. DO NOT EDIT.
|
|
package rtmpfakes
|
|
|
|
import (
|
|
"io"
|
|
"srsx/internal/rtmp"
|
|
"sync"
|
|
)
|
|
|
|
type FakeHandshake struct {
|
|
C1S1Stub func() []byte
|
|
c1S1Mutex sync.RWMutex
|
|
c1S1ArgsForCall []struct {
|
|
}
|
|
c1S1Returns struct {
|
|
result1 []byte
|
|
}
|
|
c1S1ReturnsOnCall map[int]struct {
|
|
result1 []byte
|
|
}
|
|
ReadC0S0Stub func(io.Reader) ([]byte, error)
|
|
readC0S0Mutex sync.RWMutex
|
|
readC0S0ArgsForCall []struct {
|
|
arg1 io.Reader
|
|
}
|
|
readC0S0Returns struct {
|
|
result1 []byte
|
|
result2 error
|
|
}
|
|
readC0S0ReturnsOnCall map[int]struct {
|
|
result1 []byte
|
|
result2 error
|
|
}
|
|
ReadC1S1Stub func(io.Reader) ([]byte, error)
|
|
readC1S1Mutex sync.RWMutex
|
|
readC1S1ArgsForCall []struct {
|
|
arg1 io.Reader
|
|
}
|
|
readC1S1Returns struct {
|
|
result1 []byte
|
|
result2 error
|
|
}
|
|
readC1S1ReturnsOnCall map[int]struct {
|
|
result1 []byte
|
|
result2 error
|
|
}
|
|
ReadC2S2Stub func(io.Reader) ([]byte, error)
|
|
readC2S2Mutex sync.RWMutex
|
|
readC2S2ArgsForCall []struct {
|
|
arg1 io.Reader
|
|
}
|
|
readC2S2Returns struct {
|
|
result1 []byte
|
|
result2 error
|
|
}
|
|
readC2S2ReturnsOnCall map[int]struct {
|
|
result1 []byte
|
|
result2 error
|
|
}
|
|
WriteC0S0Stub func(io.Writer) error
|
|
writeC0S0Mutex sync.RWMutex
|
|
writeC0S0ArgsForCall []struct {
|
|
arg1 io.Writer
|
|
}
|
|
writeC0S0Returns struct {
|
|
result1 error
|
|
}
|
|
writeC0S0ReturnsOnCall map[int]struct {
|
|
result1 error
|
|
}
|
|
WriteC1S1Stub func(io.Writer) error
|
|
writeC1S1Mutex sync.RWMutex
|
|
writeC1S1ArgsForCall []struct {
|
|
arg1 io.Writer
|
|
}
|
|
writeC1S1Returns struct {
|
|
result1 error
|
|
}
|
|
writeC1S1ReturnsOnCall map[int]struct {
|
|
result1 error
|
|
}
|
|
WriteC2S2Stub func(io.Writer, []byte) error
|
|
writeC2S2Mutex sync.RWMutex
|
|
writeC2S2ArgsForCall []struct {
|
|
arg1 io.Writer
|
|
arg2 []byte
|
|
}
|
|
writeC2S2Returns struct {
|
|
result1 error
|
|
}
|
|
writeC2S2ReturnsOnCall map[int]struct {
|
|
result1 error
|
|
}
|
|
invocations map[string][][]interface{}
|
|
invocationsMutex sync.RWMutex
|
|
}
|
|
|
|
func (fake *FakeHandshake) C1S1() []byte {
|
|
fake.c1S1Mutex.Lock()
|
|
ret, specificReturn := fake.c1S1ReturnsOnCall[len(fake.c1S1ArgsForCall)]
|
|
fake.c1S1ArgsForCall = append(fake.c1S1ArgsForCall, struct {
|
|
}{})
|
|
stub := fake.C1S1Stub
|
|
fakeReturns := fake.c1S1Returns
|
|
fake.recordInvocation("C1S1", []interface{}{})
|
|
fake.c1S1Mutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *FakeHandshake) C1S1CallCount() int {
|
|
fake.c1S1Mutex.RLock()
|
|
defer fake.c1S1Mutex.RUnlock()
|
|
return len(fake.c1S1ArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeHandshake) C1S1Calls(stub func() []byte) {
|
|
fake.c1S1Mutex.Lock()
|
|
defer fake.c1S1Mutex.Unlock()
|
|
fake.C1S1Stub = stub
|
|
}
|
|
|
|
func (fake *FakeHandshake) C1S1Returns(result1 []byte) {
|
|
fake.c1S1Mutex.Lock()
|
|
defer fake.c1S1Mutex.Unlock()
|
|
fake.C1S1Stub = nil
|
|
fake.c1S1Returns = struct {
|
|
result1 []byte
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) C1S1ReturnsOnCall(i int, result1 []byte) {
|
|
fake.c1S1Mutex.Lock()
|
|
defer fake.c1S1Mutex.Unlock()
|
|
fake.C1S1Stub = nil
|
|
if fake.c1S1ReturnsOnCall == nil {
|
|
fake.c1S1ReturnsOnCall = make(map[int]struct {
|
|
result1 []byte
|
|
})
|
|
}
|
|
fake.c1S1ReturnsOnCall[i] = struct {
|
|
result1 []byte
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC0S0(arg1 io.Reader) ([]byte, error) {
|
|
fake.readC0S0Mutex.Lock()
|
|
ret, specificReturn := fake.readC0S0ReturnsOnCall[len(fake.readC0S0ArgsForCall)]
|
|
fake.readC0S0ArgsForCall = append(fake.readC0S0ArgsForCall, struct {
|
|
arg1 io.Reader
|
|
}{arg1})
|
|
stub := fake.ReadC0S0Stub
|
|
fakeReturns := fake.readC0S0Returns
|
|
fake.recordInvocation("ReadC0S0", []interface{}{arg1})
|
|
fake.readC0S0Mutex.Unlock()
|
|
if stub != nil {
|
|
return stub(arg1)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1, ret.result2
|
|
}
|
|
return fakeReturns.result1, fakeReturns.result2
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC0S0CallCount() int {
|
|
fake.readC0S0Mutex.RLock()
|
|
defer fake.readC0S0Mutex.RUnlock()
|
|
return len(fake.readC0S0ArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC0S0Calls(stub func(io.Reader) ([]byte, error)) {
|
|
fake.readC0S0Mutex.Lock()
|
|
defer fake.readC0S0Mutex.Unlock()
|
|
fake.ReadC0S0Stub = stub
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC0S0ArgsForCall(i int) io.Reader {
|
|
fake.readC0S0Mutex.RLock()
|
|
defer fake.readC0S0Mutex.RUnlock()
|
|
argsForCall := fake.readC0S0ArgsForCall[i]
|
|
return argsForCall.arg1
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC0S0Returns(result1 []byte, result2 error) {
|
|
fake.readC0S0Mutex.Lock()
|
|
defer fake.readC0S0Mutex.Unlock()
|
|
fake.ReadC0S0Stub = nil
|
|
fake.readC0S0Returns = struct {
|
|
result1 []byte
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC0S0ReturnsOnCall(i int, result1 []byte, result2 error) {
|
|
fake.readC0S0Mutex.Lock()
|
|
defer fake.readC0S0Mutex.Unlock()
|
|
fake.ReadC0S0Stub = nil
|
|
if fake.readC0S0ReturnsOnCall == nil {
|
|
fake.readC0S0ReturnsOnCall = make(map[int]struct {
|
|
result1 []byte
|
|
result2 error
|
|
})
|
|
}
|
|
fake.readC0S0ReturnsOnCall[i] = struct {
|
|
result1 []byte
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC1S1(arg1 io.Reader) ([]byte, error) {
|
|
fake.readC1S1Mutex.Lock()
|
|
ret, specificReturn := fake.readC1S1ReturnsOnCall[len(fake.readC1S1ArgsForCall)]
|
|
fake.readC1S1ArgsForCall = append(fake.readC1S1ArgsForCall, struct {
|
|
arg1 io.Reader
|
|
}{arg1})
|
|
stub := fake.ReadC1S1Stub
|
|
fakeReturns := fake.readC1S1Returns
|
|
fake.recordInvocation("ReadC1S1", []interface{}{arg1})
|
|
fake.readC1S1Mutex.Unlock()
|
|
if stub != nil {
|
|
return stub(arg1)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1, ret.result2
|
|
}
|
|
return fakeReturns.result1, fakeReturns.result2
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC1S1CallCount() int {
|
|
fake.readC1S1Mutex.RLock()
|
|
defer fake.readC1S1Mutex.RUnlock()
|
|
return len(fake.readC1S1ArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC1S1Calls(stub func(io.Reader) ([]byte, error)) {
|
|
fake.readC1S1Mutex.Lock()
|
|
defer fake.readC1S1Mutex.Unlock()
|
|
fake.ReadC1S1Stub = stub
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC1S1ArgsForCall(i int) io.Reader {
|
|
fake.readC1S1Mutex.RLock()
|
|
defer fake.readC1S1Mutex.RUnlock()
|
|
argsForCall := fake.readC1S1ArgsForCall[i]
|
|
return argsForCall.arg1
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC1S1Returns(result1 []byte, result2 error) {
|
|
fake.readC1S1Mutex.Lock()
|
|
defer fake.readC1S1Mutex.Unlock()
|
|
fake.ReadC1S1Stub = nil
|
|
fake.readC1S1Returns = struct {
|
|
result1 []byte
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC1S1ReturnsOnCall(i int, result1 []byte, result2 error) {
|
|
fake.readC1S1Mutex.Lock()
|
|
defer fake.readC1S1Mutex.Unlock()
|
|
fake.ReadC1S1Stub = nil
|
|
if fake.readC1S1ReturnsOnCall == nil {
|
|
fake.readC1S1ReturnsOnCall = make(map[int]struct {
|
|
result1 []byte
|
|
result2 error
|
|
})
|
|
}
|
|
fake.readC1S1ReturnsOnCall[i] = struct {
|
|
result1 []byte
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC2S2(arg1 io.Reader) ([]byte, error) {
|
|
fake.readC2S2Mutex.Lock()
|
|
ret, specificReturn := fake.readC2S2ReturnsOnCall[len(fake.readC2S2ArgsForCall)]
|
|
fake.readC2S2ArgsForCall = append(fake.readC2S2ArgsForCall, struct {
|
|
arg1 io.Reader
|
|
}{arg1})
|
|
stub := fake.ReadC2S2Stub
|
|
fakeReturns := fake.readC2S2Returns
|
|
fake.recordInvocation("ReadC2S2", []interface{}{arg1})
|
|
fake.readC2S2Mutex.Unlock()
|
|
if stub != nil {
|
|
return stub(arg1)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1, ret.result2
|
|
}
|
|
return fakeReturns.result1, fakeReturns.result2
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC2S2CallCount() int {
|
|
fake.readC2S2Mutex.RLock()
|
|
defer fake.readC2S2Mutex.RUnlock()
|
|
return len(fake.readC2S2ArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC2S2Calls(stub func(io.Reader) ([]byte, error)) {
|
|
fake.readC2S2Mutex.Lock()
|
|
defer fake.readC2S2Mutex.Unlock()
|
|
fake.ReadC2S2Stub = stub
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC2S2ArgsForCall(i int) io.Reader {
|
|
fake.readC2S2Mutex.RLock()
|
|
defer fake.readC2S2Mutex.RUnlock()
|
|
argsForCall := fake.readC2S2ArgsForCall[i]
|
|
return argsForCall.arg1
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC2S2Returns(result1 []byte, result2 error) {
|
|
fake.readC2S2Mutex.Lock()
|
|
defer fake.readC2S2Mutex.Unlock()
|
|
fake.ReadC2S2Stub = nil
|
|
fake.readC2S2Returns = struct {
|
|
result1 []byte
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeHandshake) ReadC2S2ReturnsOnCall(i int, result1 []byte, result2 error) {
|
|
fake.readC2S2Mutex.Lock()
|
|
defer fake.readC2S2Mutex.Unlock()
|
|
fake.ReadC2S2Stub = nil
|
|
if fake.readC2S2ReturnsOnCall == nil {
|
|
fake.readC2S2ReturnsOnCall = make(map[int]struct {
|
|
result1 []byte
|
|
result2 error
|
|
})
|
|
}
|
|
fake.readC2S2ReturnsOnCall[i] = struct {
|
|
result1 []byte
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC0S0(arg1 io.Writer) error {
|
|
fake.writeC0S0Mutex.Lock()
|
|
ret, specificReturn := fake.writeC0S0ReturnsOnCall[len(fake.writeC0S0ArgsForCall)]
|
|
fake.writeC0S0ArgsForCall = append(fake.writeC0S0ArgsForCall, struct {
|
|
arg1 io.Writer
|
|
}{arg1})
|
|
stub := fake.WriteC0S0Stub
|
|
fakeReturns := fake.writeC0S0Returns
|
|
fake.recordInvocation("WriteC0S0", []interface{}{arg1})
|
|
fake.writeC0S0Mutex.Unlock()
|
|
if stub != nil {
|
|
return stub(arg1)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC0S0CallCount() int {
|
|
fake.writeC0S0Mutex.RLock()
|
|
defer fake.writeC0S0Mutex.RUnlock()
|
|
return len(fake.writeC0S0ArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC0S0Calls(stub func(io.Writer) error) {
|
|
fake.writeC0S0Mutex.Lock()
|
|
defer fake.writeC0S0Mutex.Unlock()
|
|
fake.WriteC0S0Stub = stub
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC0S0ArgsForCall(i int) io.Writer {
|
|
fake.writeC0S0Mutex.RLock()
|
|
defer fake.writeC0S0Mutex.RUnlock()
|
|
argsForCall := fake.writeC0S0ArgsForCall[i]
|
|
return argsForCall.arg1
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC0S0Returns(result1 error) {
|
|
fake.writeC0S0Mutex.Lock()
|
|
defer fake.writeC0S0Mutex.Unlock()
|
|
fake.WriteC0S0Stub = nil
|
|
fake.writeC0S0Returns = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC0S0ReturnsOnCall(i int, result1 error) {
|
|
fake.writeC0S0Mutex.Lock()
|
|
defer fake.writeC0S0Mutex.Unlock()
|
|
fake.WriteC0S0Stub = nil
|
|
if fake.writeC0S0ReturnsOnCall == nil {
|
|
fake.writeC0S0ReturnsOnCall = make(map[int]struct {
|
|
result1 error
|
|
})
|
|
}
|
|
fake.writeC0S0ReturnsOnCall[i] = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC1S1(arg1 io.Writer) error {
|
|
fake.writeC1S1Mutex.Lock()
|
|
ret, specificReturn := fake.writeC1S1ReturnsOnCall[len(fake.writeC1S1ArgsForCall)]
|
|
fake.writeC1S1ArgsForCall = append(fake.writeC1S1ArgsForCall, struct {
|
|
arg1 io.Writer
|
|
}{arg1})
|
|
stub := fake.WriteC1S1Stub
|
|
fakeReturns := fake.writeC1S1Returns
|
|
fake.recordInvocation("WriteC1S1", []interface{}{arg1})
|
|
fake.writeC1S1Mutex.Unlock()
|
|
if stub != nil {
|
|
return stub(arg1)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC1S1CallCount() int {
|
|
fake.writeC1S1Mutex.RLock()
|
|
defer fake.writeC1S1Mutex.RUnlock()
|
|
return len(fake.writeC1S1ArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC1S1Calls(stub func(io.Writer) error) {
|
|
fake.writeC1S1Mutex.Lock()
|
|
defer fake.writeC1S1Mutex.Unlock()
|
|
fake.WriteC1S1Stub = stub
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC1S1ArgsForCall(i int) io.Writer {
|
|
fake.writeC1S1Mutex.RLock()
|
|
defer fake.writeC1S1Mutex.RUnlock()
|
|
argsForCall := fake.writeC1S1ArgsForCall[i]
|
|
return argsForCall.arg1
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC1S1Returns(result1 error) {
|
|
fake.writeC1S1Mutex.Lock()
|
|
defer fake.writeC1S1Mutex.Unlock()
|
|
fake.WriteC1S1Stub = nil
|
|
fake.writeC1S1Returns = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC1S1ReturnsOnCall(i int, result1 error) {
|
|
fake.writeC1S1Mutex.Lock()
|
|
defer fake.writeC1S1Mutex.Unlock()
|
|
fake.WriteC1S1Stub = nil
|
|
if fake.writeC1S1ReturnsOnCall == nil {
|
|
fake.writeC1S1ReturnsOnCall = make(map[int]struct {
|
|
result1 error
|
|
})
|
|
}
|
|
fake.writeC1S1ReturnsOnCall[i] = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC2S2(arg1 io.Writer, arg2 []byte) error {
|
|
var arg2Copy []byte
|
|
if arg2 != nil {
|
|
arg2Copy = make([]byte, len(arg2))
|
|
copy(arg2Copy, arg2)
|
|
}
|
|
fake.writeC2S2Mutex.Lock()
|
|
ret, specificReturn := fake.writeC2S2ReturnsOnCall[len(fake.writeC2S2ArgsForCall)]
|
|
fake.writeC2S2ArgsForCall = append(fake.writeC2S2ArgsForCall, struct {
|
|
arg1 io.Writer
|
|
arg2 []byte
|
|
}{arg1, arg2Copy})
|
|
stub := fake.WriteC2S2Stub
|
|
fakeReturns := fake.writeC2S2Returns
|
|
fake.recordInvocation("WriteC2S2", []interface{}{arg1, arg2Copy})
|
|
fake.writeC2S2Mutex.Unlock()
|
|
if stub != nil {
|
|
return stub(arg1, arg2)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC2S2CallCount() int {
|
|
fake.writeC2S2Mutex.RLock()
|
|
defer fake.writeC2S2Mutex.RUnlock()
|
|
return len(fake.writeC2S2ArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC2S2Calls(stub func(io.Writer, []byte) error) {
|
|
fake.writeC2S2Mutex.Lock()
|
|
defer fake.writeC2S2Mutex.Unlock()
|
|
fake.WriteC2S2Stub = stub
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC2S2ArgsForCall(i int) (io.Writer, []byte) {
|
|
fake.writeC2S2Mutex.RLock()
|
|
defer fake.writeC2S2Mutex.RUnlock()
|
|
argsForCall := fake.writeC2S2ArgsForCall[i]
|
|
return argsForCall.arg1, argsForCall.arg2
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC2S2Returns(result1 error) {
|
|
fake.writeC2S2Mutex.Lock()
|
|
defer fake.writeC2S2Mutex.Unlock()
|
|
fake.WriteC2S2Stub = nil
|
|
fake.writeC2S2Returns = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) WriteC2S2ReturnsOnCall(i int, result1 error) {
|
|
fake.writeC2S2Mutex.Lock()
|
|
defer fake.writeC2S2Mutex.Unlock()
|
|
fake.WriteC2S2Stub = nil
|
|
if fake.writeC2S2ReturnsOnCall == nil {
|
|
fake.writeC2S2ReturnsOnCall = make(map[int]struct {
|
|
result1 error
|
|
})
|
|
}
|
|
fake.writeC2S2ReturnsOnCall[i] = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeHandshake) Invocations() map[string][][]interface{} {
|
|
fake.invocationsMutex.RLock()
|
|
defer fake.invocationsMutex.RUnlock()
|
|
copiedInvocations := map[string][][]interface{}{}
|
|
for key, value := range fake.invocations {
|
|
copiedInvocations[key] = value
|
|
}
|
|
return copiedInvocations
|
|
}
|
|
|
|
func (fake *FakeHandshake) 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 _ rtmp.Handshake = new(FakeHandshake)
|