mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
c6334e61aa
This adds the ability to have multiple concurrent connections to a single device. This is primarily useful when the network has multiple physical links for aggregated bandwidth. A single connection will never see a higher rate than a single link can give, but multiple connections are load-balanced over multiple links. It is also incidentally useful for older multi-core CPUs, where bandwidth could be limited by the TLS performance of a single CPU core -- using multiple connections achieves concurrency in the required crypto calculations... Co-authored-by: Simon Frei <freisim93@gmail.com> Co-authored-by: tomasz1986 <twilczynski@naver.com> Co-authored-by: bt90 <btom1990@googlemail.com>
625 lines
16 KiB
Go
625 lines
16 KiB
Go
// Code generated by counterfeiter. DO NOT EDIT.
|
|
package mocks
|
|
|
|
import (
|
|
"net"
|
|
"sync"
|
|
"time"
|
|
|
|
"github.com/syncthing/syncthing/lib/protocol"
|
|
)
|
|
|
|
type ConnectionInfo struct {
|
|
ConnectionIDStub func() string
|
|
connectionIDMutex sync.RWMutex
|
|
connectionIDArgsForCall []struct {
|
|
}
|
|
connectionIDReturns struct {
|
|
result1 string
|
|
}
|
|
connectionIDReturnsOnCall map[int]struct {
|
|
result1 string
|
|
}
|
|
CryptoStub func() string
|
|
cryptoMutex sync.RWMutex
|
|
cryptoArgsForCall []struct {
|
|
}
|
|
cryptoReturns struct {
|
|
result1 string
|
|
}
|
|
cryptoReturnsOnCall map[int]struct {
|
|
result1 string
|
|
}
|
|
EstablishedAtStub func() time.Time
|
|
establishedAtMutex sync.RWMutex
|
|
establishedAtArgsForCall []struct {
|
|
}
|
|
establishedAtReturns struct {
|
|
result1 time.Time
|
|
}
|
|
establishedAtReturnsOnCall map[int]struct {
|
|
result1 time.Time
|
|
}
|
|
IsLocalStub func() bool
|
|
isLocalMutex sync.RWMutex
|
|
isLocalArgsForCall []struct {
|
|
}
|
|
isLocalReturns struct {
|
|
result1 bool
|
|
}
|
|
isLocalReturnsOnCall map[int]struct {
|
|
result1 bool
|
|
}
|
|
PriorityStub func() int
|
|
priorityMutex sync.RWMutex
|
|
priorityArgsForCall []struct {
|
|
}
|
|
priorityReturns struct {
|
|
result1 int
|
|
}
|
|
priorityReturnsOnCall map[int]struct {
|
|
result1 int
|
|
}
|
|
RemoteAddrStub func() net.Addr
|
|
remoteAddrMutex sync.RWMutex
|
|
remoteAddrArgsForCall []struct {
|
|
}
|
|
remoteAddrReturns struct {
|
|
result1 net.Addr
|
|
}
|
|
remoteAddrReturnsOnCall map[int]struct {
|
|
result1 net.Addr
|
|
}
|
|
StringStub func() string
|
|
stringMutex sync.RWMutex
|
|
stringArgsForCall []struct {
|
|
}
|
|
stringReturns struct {
|
|
result1 string
|
|
}
|
|
stringReturnsOnCall map[int]struct {
|
|
result1 string
|
|
}
|
|
TransportStub func() string
|
|
transportMutex sync.RWMutex
|
|
transportArgsForCall []struct {
|
|
}
|
|
transportReturns struct {
|
|
result1 string
|
|
}
|
|
transportReturnsOnCall map[int]struct {
|
|
result1 string
|
|
}
|
|
TypeStub func() string
|
|
typeMutex sync.RWMutex
|
|
typeArgsForCall []struct {
|
|
}
|
|
typeReturns struct {
|
|
result1 string
|
|
}
|
|
typeReturnsOnCall map[int]struct {
|
|
result1 string
|
|
}
|
|
invocations map[string][][]interface{}
|
|
invocationsMutex sync.RWMutex
|
|
}
|
|
|
|
func (fake *ConnectionInfo) ConnectionID() string {
|
|
fake.connectionIDMutex.Lock()
|
|
ret, specificReturn := fake.connectionIDReturnsOnCall[len(fake.connectionIDArgsForCall)]
|
|
fake.connectionIDArgsForCall = append(fake.connectionIDArgsForCall, struct {
|
|
}{})
|
|
stub := fake.ConnectionIDStub
|
|
fakeReturns := fake.connectionIDReturns
|
|
fake.recordInvocation("ConnectionID", []interface{}{})
|
|
fake.connectionIDMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) ConnectionIDCallCount() int {
|
|
fake.connectionIDMutex.RLock()
|
|
defer fake.connectionIDMutex.RUnlock()
|
|
return len(fake.connectionIDArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) ConnectionIDCalls(stub func() string) {
|
|
fake.connectionIDMutex.Lock()
|
|
defer fake.connectionIDMutex.Unlock()
|
|
fake.ConnectionIDStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) ConnectionIDReturns(result1 string) {
|
|
fake.connectionIDMutex.Lock()
|
|
defer fake.connectionIDMutex.Unlock()
|
|
fake.ConnectionIDStub = nil
|
|
fake.connectionIDReturns = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) ConnectionIDReturnsOnCall(i int, result1 string) {
|
|
fake.connectionIDMutex.Lock()
|
|
defer fake.connectionIDMutex.Unlock()
|
|
fake.ConnectionIDStub = nil
|
|
if fake.connectionIDReturnsOnCall == nil {
|
|
fake.connectionIDReturnsOnCall = make(map[int]struct {
|
|
result1 string
|
|
})
|
|
}
|
|
fake.connectionIDReturnsOnCall[i] = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) Crypto() string {
|
|
fake.cryptoMutex.Lock()
|
|
ret, specificReturn := fake.cryptoReturnsOnCall[len(fake.cryptoArgsForCall)]
|
|
fake.cryptoArgsForCall = append(fake.cryptoArgsForCall, struct {
|
|
}{})
|
|
stub := fake.CryptoStub
|
|
fakeReturns := fake.cryptoReturns
|
|
fake.recordInvocation("Crypto", []interface{}{})
|
|
fake.cryptoMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) CryptoCallCount() int {
|
|
fake.cryptoMutex.RLock()
|
|
defer fake.cryptoMutex.RUnlock()
|
|
return len(fake.cryptoArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) CryptoCalls(stub func() string) {
|
|
fake.cryptoMutex.Lock()
|
|
defer fake.cryptoMutex.Unlock()
|
|
fake.CryptoStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) CryptoReturns(result1 string) {
|
|
fake.cryptoMutex.Lock()
|
|
defer fake.cryptoMutex.Unlock()
|
|
fake.CryptoStub = nil
|
|
fake.cryptoReturns = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) CryptoReturnsOnCall(i int, result1 string) {
|
|
fake.cryptoMutex.Lock()
|
|
defer fake.cryptoMutex.Unlock()
|
|
fake.CryptoStub = nil
|
|
if fake.cryptoReturnsOnCall == nil {
|
|
fake.cryptoReturnsOnCall = make(map[int]struct {
|
|
result1 string
|
|
})
|
|
}
|
|
fake.cryptoReturnsOnCall[i] = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) EstablishedAt() time.Time {
|
|
fake.establishedAtMutex.Lock()
|
|
ret, specificReturn := fake.establishedAtReturnsOnCall[len(fake.establishedAtArgsForCall)]
|
|
fake.establishedAtArgsForCall = append(fake.establishedAtArgsForCall, struct {
|
|
}{})
|
|
stub := fake.EstablishedAtStub
|
|
fakeReturns := fake.establishedAtReturns
|
|
fake.recordInvocation("EstablishedAt", []interface{}{})
|
|
fake.establishedAtMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) EstablishedAtCallCount() int {
|
|
fake.establishedAtMutex.RLock()
|
|
defer fake.establishedAtMutex.RUnlock()
|
|
return len(fake.establishedAtArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) EstablishedAtCalls(stub func() time.Time) {
|
|
fake.establishedAtMutex.Lock()
|
|
defer fake.establishedAtMutex.Unlock()
|
|
fake.EstablishedAtStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) EstablishedAtReturns(result1 time.Time) {
|
|
fake.establishedAtMutex.Lock()
|
|
defer fake.establishedAtMutex.Unlock()
|
|
fake.EstablishedAtStub = nil
|
|
fake.establishedAtReturns = struct {
|
|
result1 time.Time
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) EstablishedAtReturnsOnCall(i int, result1 time.Time) {
|
|
fake.establishedAtMutex.Lock()
|
|
defer fake.establishedAtMutex.Unlock()
|
|
fake.EstablishedAtStub = nil
|
|
if fake.establishedAtReturnsOnCall == nil {
|
|
fake.establishedAtReturnsOnCall = make(map[int]struct {
|
|
result1 time.Time
|
|
})
|
|
}
|
|
fake.establishedAtReturnsOnCall[i] = struct {
|
|
result1 time.Time
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) IsLocal() bool {
|
|
fake.isLocalMutex.Lock()
|
|
ret, specificReturn := fake.isLocalReturnsOnCall[len(fake.isLocalArgsForCall)]
|
|
fake.isLocalArgsForCall = append(fake.isLocalArgsForCall, struct {
|
|
}{})
|
|
stub := fake.IsLocalStub
|
|
fakeReturns := fake.isLocalReturns
|
|
fake.recordInvocation("IsLocal", []interface{}{})
|
|
fake.isLocalMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) IsLocalCallCount() int {
|
|
fake.isLocalMutex.RLock()
|
|
defer fake.isLocalMutex.RUnlock()
|
|
return len(fake.isLocalArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) IsLocalCalls(stub func() bool) {
|
|
fake.isLocalMutex.Lock()
|
|
defer fake.isLocalMutex.Unlock()
|
|
fake.IsLocalStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) IsLocalReturns(result1 bool) {
|
|
fake.isLocalMutex.Lock()
|
|
defer fake.isLocalMutex.Unlock()
|
|
fake.IsLocalStub = nil
|
|
fake.isLocalReturns = struct {
|
|
result1 bool
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) IsLocalReturnsOnCall(i int, result1 bool) {
|
|
fake.isLocalMutex.Lock()
|
|
defer fake.isLocalMutex.Unlock()
|
|
fake.IsLocalStub = nil
|
|
if fake.isLocalReturnsOnCall == nil {
|
|
fake.isLocalReturnsOnCall = make(map[int]struct {
|
|
result1 bool
|
|
})
|
|
}
|
|
fake.isLocalReturnsOnCall[i] = struct {
|
|
result1 bool
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) Priority() int {
|
|
fake.priorityMutex.Lock()
|
|
ret, specificReturn := fake.priorityReturnsOnCall[len(fake.priorityArgsForCall)]
|
|
fake.priorityArgsForCall = append(fake.priorityArgsForCall, struct {
|
|
}{})
|
|
stub := fake.PriorityStub
|
|
fakeReturns := fake.priorityReturns
|
|
fake.recordInvocation("Priority", []interface{}{})
|
|
fake.priorityMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) PriorityCallCount() int {
|
|
fake.priorityMutex.RLock()
|
|
defer fake.priorityMutex.RUnlock()
|
|
return len(fake.priorityArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) PriorityCalls(stub func() int) {
|
|
fake.priorityMutex.Lock()
|
|
defer fake.priorityMutex.Unlock()
|
|
fake.PriorityStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) PriorityReturns(result1 int) {
|
|
fake.priorityMutex.Lock()
|
|
defer fake.priorityMutex.Unlock()
|
|
fake.PriorityStub = nil
|
|
fake.priorityReturns = struct {
|
|
result1 int
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) PriorityReturnsOnCall(i int, result1 int) {
|
|
fake.priorityMutex.Lock()
|
|
defer fake.priorityMutex.Unlock()
|
|
fake.PriorityStub = nil
|
|
if fake.priorityReturnsOnCall == nil {
|
|
fake.priorityReturnsOnCall = make(map[int]struct {
|
|
result1 int
|
|
})
|
|
}
|
|
fake.priorityReturnsOnCall[i] = struct {
|
|
result1 int
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) RemoteAddr() net.Addr {
|
|
fake.remoteAddrMutex.Lock()
|
|
ret, specificReturn := fake.remoteAddrReturnsOnCall[len(fake.remoteAddrArgsForCall)]
|
|
fake.remoteAddrArgsForCall = append(fake.remoteAddrArgsForCall, struct {
|
|
}{})
|
|
stub := fake.RemoteAddrStub
|
|
fakeReturns := fake.remoteAddrReturns
|
|
fake.recordInvocation("RemoteAddr", []interface{}{})
|
|
fake.remoteAddrMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) RemoteAddrCallCount() int {
|
|
fake.remoteAddrMutex.RLock()
|
|
defer fake.remoteAddrMutex.RUnlock()
|
|
return len(fake.remoteAddrArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) RemoteAddrCalls(stub func() net.Addr) {
|
|
fake.remoteAddrMutex.Lock()
|
|
defer fake.remoteAddrMutex.Unlock()
|
|
fake.RemoteAddrStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) RemoteAddrReturns(result1 net.Addr) {
|
|
fake.remoteAddrMutex.Lock()
|
|
defer fake.remoteAddrMutex.Unlock()
|
|
fake.RemoteAddrStub = nil
|
|
fake.remoteAddrReturns = struct {
|
|
result1 net.Addr
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) RemoteAddrReturnsOnCall(i int, result1 net.Addr) {
|
|
fake.remoteAddrMutex.Lock()
|
|
defer fake.remoteAddrMutex.Unlock()
|
|
fake.RemoteAddrStub = nil
|
|
if fake.remoteAddrReturnsOnCall == nil {
|
|
fake.remoteAddrReturnsOnCall = make(map[int]struct {
|
|
result1 net.Addr
|
|
})
|
|
}
|
|
fake.remoteAddrReturnsOnCall[i] = struct {
|
|
result1 net.Addr
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) String() string {
|
|
fake.stringMutex.Lock()
|
|
ret, specificReturn := fake.stringReturnsOnCall[len(fake.stringArgsForCall)]
|
|
fake.stringArgsForCall = append(fake.stringArgsForCall, struct {
|
|
}{})
|
|
stub := fake.StringStub
|
|
fakeReturns := fake.stringReturns
|
|
fake.recordInvocation("String", []interface{}{})
|
|
fake.stringMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) StringCallCount() int {
|
|
fake.stringMutex.RLock()
|
|
defer fake.stringMutex.RUnlock()
|
|
return len(fake.stringArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) StringCalls(stub func() string) {
|
|
fake.stringMutex.Lock()
|
|
defer fake.stringMutex.Unlock()
|
|
fake.StringStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) StringReturns(result1 string) {
|
|
fake.stringMutex.Lock()
|
|
defer fake.stringMutex.Unlock()
|
|
fake.StringStub = nil
|
|
fake.stringReturns = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) StringReturnsOnCall(i int, result1 string) {
|
|
fake.stringMutex.Lock()
|
|
defer fake.stringMutex.Unlock()
|
|
fake.StringStub = nil
|
|
if fake.stringReturnsOnCall == nil {
|
|
fake.stringReturnsOnCall = make(map[int]struct {
|
|
result1 string
|
|
})
|
|
}
|
|
fake.stringReturnsOnCall[i] = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) Transport() string {
|
|
fake.transportMutex.Lock()
|
|
ret, specificReturn := fake.transportReturnsOnCall[len(fake.transportArgsForCall)]
|
|
fake.transportArgsForCall = append(fake.transportArgsForCall, struct {
|
|
}{})
|
|
stub := fake.TransportStub
|
|
fakeReturns := fake.transportReturns
|
|
fake.recordInvocation("Transport", []interface{}{})
|
|
fake.transportMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TransportCallCount() int {
|
|
fake.transportMutex.RLock()
|
|
defer fake.transportMutex.RUnlock()
|
|
return len(fake.transportArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TransportCalls(stub func() string) {
|
|
fake.transportMutex.Lock()
|
|
defer fake.transportMutex.Unlock()
|
|
fake.TransportStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TransportReturns(result1 string) {
|
|
fake.transportMutex.Lock()
|
|
defer fake.transportMutex.Unlock()
|
|
fake.TransportStub = nil
|
|
fake.transportReturns = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TransportReturnsOnCall(i int, result1 string) {
|
|
fake.transportMutex.Lock()
|
|
defer fake.transportMutex.Unlock()
|
|
fake.TransportStub = nil
|
|
if fake.transportReturnsOnCall == nil {
|
|
fake.transportReturnsOnCall = make(map[int]struct {
|
|
result1 string
|
|
})
|
|
}
|
|
fake.transportReturnsOnCall[i] = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) Type() string {
|
|
fake.typeMutex.Lock()
|
|
ret, specificReturn := fake.typeReturnsOnCall[len(fake.typeArgsForCall)]
|
|
fake.typeArgsForCall = append(fake.typeArgsForCall, struct {
|
|
}{})
|
|
stub := fake.TypeStub
|
|
fakeReturns := fake.typeReturns
|
|
fake.recordInvocation("Type", []interface{}{})
|
|
fake.typeMutex.Unlock()
|
|
if stub != nil {
|
|
return stub()
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fakeReturns.result1
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TypeCallCount() int {
|
|
fake.typeMutex.RLock()
|
|
defer fake.typeMutex.RUnlock()
|
|
return len(fake.typeArgsForCall)
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TypeCalls(stub func() string) {
|
|
fake.typeMutex.Lock()
|
|
defer fake.typeMutex.Unlock()
|
|
fake.TypeStub = stub
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TypeReturns(result1 string) {
|
|
fake.typeMutex.Lock()
|
|
defer fake.typeMutex.Unlock()
|
|
fake.TypeStub = nil
|
|
fake.typeReturns = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) TypeReturnsOnCall(i int, result1 string) {
|
|
fake.typeMutex.Lock()
|
|
defer fake.typeMutex.Unlock()
|
|
fake.TypeStub = nil
|
|
if fake.typeReturnsOnCall == nil {
|
|
fake.typeReturnsOnCall = make(map[int]struct {
|
|
result1 string
|
|
})
|
|
}
|
|
fake.typeReturnsOnCall[i] = struct {
|
|
result1 string
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *ConnectionInfo) Invocations() map[string][][]interface{} {
|
|
fake.invocationsMutex.RLock()
|
|
defer fake.invocationsMutex.RUnlock()
|
|
fake.connectionIDMutex.RLock()
|
|
defer fake.connectionIDMutex.RUnlock()
|
|
fake.cryptoMutex.RLock()
|
|
defer fake.cryptoMutex.RUnlock()
|
|
fake.establishedAtMutex.RLock()
|
|
defer fake.establishedAtMutex.RUnlock()
|
|
fake.isLocalMutex.RLock()
|
|
defer fake.isLocalMutex.RUnlock()
|
|
fake.priorityMutex.RLock()
|
|
defer fake.priorityMutex.RUnlock()
|
|
fake.remoteAddrMutex.RLock()
|
|
defer fake.remoteAddrMutex.RUnlock()
|
|
fake.stringMutex.RLock()
|
|
defer fake.stringMutex.RUnlock()
|
|
fake.transportMutex.RLock()
|
|
defer fake.transportMutex.RUnlock()
|
|
fake.typeMutex.RLock()
|
|
defer fake.typeMutex.RUnlock()
|
|
copiedInvocations := map[string][][]interface{}{}
|
|
for key, value := range fake.invocations {
|
|
copiedInvocations[key] = value
|
|
}
|
|
return copiedInvocations
|
|
}
|
|
|
|
func (fake *ConnectionInfo) 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 _ protocol.ConnectionInfo = new(ConnectionInfo)
|