12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166 |
- // Code generated by counterfeiter. DO NOT EDIT.
- package mocks
- import (
- "context"
- "net"
- "sync"
- "time"
- "github.com/syncthing/syncthing/lib/protocol"
- )
- type Connection struct {
- CloseStub func(error)
- closeMutex sync.RWMutex
- closeArgsForCall []struct {
- arg1 error
- }
- ClosedStub func() <-chan struct{}
- closedMutex sync.RWMutex
- closedArgsForCall []struct {
- }
- closedReturns struct {
- result1 <-chan struct{}
- }
- closedReturnsOnCall map[int]struct {
- result1 <-chan struct{}
- }
- ClusterConfigStub func(*protocol.ClusterConfig, map[string]string)
- clusterConfigMutex sync.RWMutex
- clusterConfigArgsForCall []struct {
- arg1 *protocol.ClusterConfig
- arg2 map[string]string
- }
- 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
- }
- DeviceIDStub func() protocol.DeviceID
- deviceIDMutex sync.RWMutex
- deviceIDArgsForCall []struct {
- }
- deviceIDReturns struct {
- result1 protocol.DeviceID
- }
- deviceIDReturnsOnCall map[int]struct {
- result1 protocol.DeviceID
- }
- DownloadProgressStub func(context.Context, *protocol.DownloadProgress)
- downloadProgressMutex sync.RWMutex
- downloadProgressArgsForCall []struct {
- arg1 context.Context
- arg2 *protocol.DownloadProgress
- }
- EstablishedAtStub func() time.Time
- establishedAtMutex sync.RWMutex
- establishedAtArgsForCall []struct {
- }
- establishedAtReturns struct {
- result1 time.Time
- }
- establishedAtReturnsOnCall map[int]struct {
- result1 time.Time
- }
- IndexStub func(context.Context, *protocol.Index) error
- indexMutex sync.RWMutex
- indexArgsForCall []struct {
- arg1 context.Context
- arg2 *protocol.Index
- }
- indexReturns struct {
- result1 error
- }
- indexReturnsOnCall map[int]struct {
- result1 error
- }
- IndexUpdateStub func(context.Context, *protocol.IndexUpdate) error
- indexUpdateMutex sync.RWMutex
- indexUpdateArgsForCall []struct {
- arg1 context.Context
- arg2 *protocol.IndexUpdate
- }
- indexUpdateReturns struct {
- result1 error
- }
- indexUpdateReturnsOnCall map[int]struct {
- result1 error
- }
- 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
- }
- RequestStub func(context.Context, *protocol.Request) ([]byte, error)
- requestMutex sync.RWMutex
- requestArgsForCall []struct {
- arg1 context.Context
- arg2 *protocol.Request
- }
- requestReturns struct {
- result1 []byte
- result2 error
- }
- requestReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- StartStub func()
- startMutex sync.RWMutex
- startArgsForCall []struct {
- }
- StatisticsStub func() protocol.Statistics
- statisticsMutex sync.RWMutex
- statisticsArgsForCall []struct {
- }
- statisticsReturns struct {
- result1 protocol.Statistics
- }
- statisticsReturnsOnCall map[int]struct {
- result1 protocol.Statistics
- }
- 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 *Connection) Close(arg1 error) {
- fake.closeMutex.Lock()
- fake.closeArgsForCall = append(fake.closeArgsForCall, struct {
- arg1 error
- }{arg1})
- stub := fake.CloseStub
- fake.recordInvocation("Close", []interface{}{arg1})
- fake.closeMutex.Unlock()
- if stub != nil {
- fake.CloseStub(arg1)
- }
- }
- func (fake *Connection) CloseCallCount() int {
- fake.closeMutex.RLock()
- defer fake.closeMutex.RUnlock()
- return len(fake.closeArgsForCall)
- }
- func (fake *Connection) CloseCalls(stub func(error)) {
- fake.closeMutex.Lock()
- defer fake.closeMutex.Unlock()
- fake.CloseStub = stub
- }
- func (fake *Connection) CloseArgsForCall(i int) error {
- fake.closeMutex.RLock()
- defer fake.closeMutex.RUnlock()
- argsForCall := fake.closeArgsForCall[i]
- return argsForCall.arg1
- }
- func (fake *Connection) Closed() <-chan struct{} {
- fake.closedMutex.Lock()
- ret, specificReturn := fake.closedReturnsOnCall[len(fake.closedArgsForCall)]
- fake.closedArgsForCall = append(fake.closedArgsForCall, struct {
- }{})
- stub := fake.ClosedStub
- fakeReturns := fake.closedReturns
- fake.recordInvocation("Closed", []interface{}{})
- fake.closedMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
- }
- func (fake *Connection) ClosedCallCount() int {
- fake.closedMutex.RLock()
- defer fake.closedMutex.RUnlock()
- return len(fake.closedArgsForCall)
- }
- func (fake *Connection) ClosedCalls(stub func() <-chan struct{}) {
- fake.closedMutex.Lock()
- defer fake.closedMutex.Unlock()
- fake.ClosedStub = stub
- }
- func (fake *Connection) ClosedReturns(result1 <-chan struct{}) {
- fake.closedMutex.Lock()
- defer fake.closedMutex.Unlock()
- fake.ClosedStub = nil
- fake.closedReturns = struct {
- result1 <-chan struct{}
- }{result1}
- }
- func (fake *Connection) ClosedReturnsOnCall(i int, result1 <-chan struct{}) {
- fake.closedMutex.Lock()
- defer fake.closedMutex.Unlock()
- fake.ClosedStub = nil
- if fake.closedReturnsOnCall == nil {
- fake.closedReturnsOnCall = make(map[int]struct {
- result1 <-chan struct{}
- })
- }
- fake.closedReturnsOnCall[i] = struct {
- result1 <-chan struct{}
- }{result1}
- }
- func (fake *Connection) ClusterConfig(arg1 *protocol.ClusterConfig, arg2 map[string]string) {
- fake.clusterConfigMutex.Lock()
- fake.clusterConfigArgsForCall = append(fake.clusterConfigArgsForCall, struct {
- arg1 *protocol.ClusterConfig
- arg2 map[string]string
- }{arg1, arg2})
- stub := fake.ClusterConfigStub
- fake.recordInvocation("ClusterConfig", []interface{}{arg1, arg2})
- fake.clusterConfigMutex.Unlock()
- if stub != nil {
- fake.ClusterConfigStub(arg1, arg2)
- }
- }
- func (fake *Connection) ClusterConfigCallCount() int {
- fake.clusterConfigMutex.RLock()
- defer fake.clusterConfigMutex.RUnlock()
- return len(fake.clusterConfigArgsForCall)
- }
- func (fake *Connection) ClusterConfigCalls(stub func(*protocol.ClusterConfig, map[string]string)) {
- fake.clusterConfigMutex.Lock()
- defer fake.clusterConfigMutex.Unlock()
- fake.ClusterConfigStub = stub
- }
- func (fake *Connection) ClusterConfigArgsForCall(i int) (*protocol.ClusterConfig, map[string]string) {
- fake.clusterConfigMutex.RLock()
- defer fake.clusterConfigMutex.RUnlock()
- argsForCall := fake.clusterConfigArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
- }
- func (fake *Connection) 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 *Connection) ConnectionIDCallCount() int {
- fake.connectionIDMutex.RLock()
- defer fake.connectionIDMutex.RUnlock()
- return len(fake.connectionIDArgsForCall)
- }
- func (fake *Connection) ConnectionIDCalls(stub func() string) {
- fake.connectionIDMutex.Lock()
- defer fake.connectionIDMutex.Unlock()
- fake.ConnectionIDStub = stub
- }
- func (fake *Connection) ConnectionIDReturns(result1 string) {
- fake.connectionIDMutex.Lock()
- defer fake.connectionIDMutex.Unlock()
- fake.ConnectionIDStub = nil
- fake.connectionIDReturns = struct {
- result1 string
- }{result1}
- }
- func (fake *Connection) 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 *Connection) 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 *Connection) CryptoCallCount() int {
- fake.cryptoMutex.RLock()
- defer fake.cryptoMutex.RUnlock()
- return len(fake.cryptoArgsForCall)
- }
- func (fake *Connection) CryptoCalls(stub func() string) {
- fake.cryptoMutex.Lock()
- defer fake.cryptoMutex.Unlock()
- fake.CryptoStub = stub
- }
- func (fake *Connection) CryptoReturns(result1 string) {
- fake.cryptoMutex.Lock()
- defer fake.cryptoMutex.Unlock()
- fake.CryptoStub = nil
- fake.cryptoReturns = struct {
- result1 string
- }{result1}
- }
- func (fake *Connection) 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 *Connection) DeviceID() protocol.DeviceID {
- fake.deviceIDMutex.Lock()
- ret, specificReturn := fake.deviceIDReturnsOnCall[len(fake.deviceIDArgsForCall)]
- fake.deviceIDArgsForCall = append(fake.deviceIDArgsForCall, struct {
- }{})
- stub := fake.DeviceIDStub
- fakeReturns := fake.deviceIDReturns
- fake.recordInvocation("DeviceID", []interface{}{})
- fake.deviceIDMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
- }
- func (fake *Connection) DeviceIDCallCount() int {
- fake.deviceIDMutex.RLock()
- defer fake.deviceIDMutex.RUnlock()
- return len(fake.deviceIDArgsForCall)
- }
- func (fake *Connection) DeviceIDCalls(stub func() protocol.DeviceID) {
- fake.deviceIDMutex.Lock()
- defer fake.deviceIDMutex.Unlock()
- fake.DeviceIDStub = stub
- }
- func (fake *Connection) DeviceIDReturns(result1 protocol.DeviceID) {
- fake.deviceIDMutex.Lock()
- defer fake.deviceIDMutex.Unlock()
- fake.DeviceIDStub = nil
- fake.deviceIDReturns = struct {
- result1 protocol.DeviceID
- }{result1}
- }
- func (fake *Connection) DeviceIDReturnsOnCall(i int, result1 protocol.DeviceID) {
- fake.deviceIDMutex.Lock()
- defer fake.deviceIDMutex.Unlock()
- fake.DeviceIDStub = nil
- if fake.deviceIDReturnsOnCall == nil {
- fake.deviceIDReturnsOnCall = make(map[int]struct {
- result1 protocol.DeviceID
- })
- }
- fake.deviceIDReturnsOnCall[i] = struct {
- result1 protocol.DeviceID
- }{result1}
- }
- func (fake *Connection) DownloadProgress(arg1 context.Context, arg2 *protocol.DownloadProgress) {
- fake.downloadProgressMutex.Lock()
- fake.downloadProgressArgsForCall = append(fake.downloadProgressArgsForCall, struct {
- arg1 context.Context
- arg2 *protocol.DownloadProgress
- }{arg1, arg2})
- stub := fake.DownloadProgressStub
- fake.recordInvocation("DownloadProgress", []interface{}{arg1, arg2})
- fake.downloadProgressMutex.Unlock()
- if stub != nil {
- fake.DownloadProgressStub(arg1, arg2)
- }
- }
- func (fake *Connection) DownloadProgressCallCount() int {
- fake.downloadProgressMutex.RLock()
- defer fake.downloadProgressMutex.RUnlock()
- return len(fake.downloadProgressArgsForCall)
- }
- func (fake *Connection) DownloadProgressCalls(stub func(context.Context, *protocol.DownloadProgress)) {
- fake.downloadProgressMutex.Lock()
- defer fake.downloadProgressMutex.Unlock()
- fake.DownloadProgressStub = stub
- }
- func (fake *Connection) DownloadProgressArgsForCall(i int) (context.Context, *protocol.DownloadProgress) {
- fake.downloadProgressMutex.RLock()
- defer fake.downloadProgressMutex.RUnlock()
- argsForCall := fake.downloadProgressArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
- }
- func (fake *Connection) 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 *Connection) EstablishedAtCallCount() int {
- fake.establishedAtMutex.RLock()
- defer fake.establishedAtMutex.RUnlock()
- return len(fake.establishedAtArgsForCall)
- }
- func (fake *Connection) EstablishedAtCalls(stub func() time.Time) {
- fake.establishedAtMutex.Lock()
- defer fake.establishedAtMutex.Unlock()
- fake.EstablishedAtStub = stub
- }
- func (fake *Connection) EstablishedAtReturns(result1 time.Time) {
- fake.establishedAtMutex.Lock()
- defer fake.establishedAtMutex.Unlock()
- fake.EstablishedAtStub = nil
- fake.establishedAtReturns = struct {
- result1 time.Time
- }{result1}
- }
- func (fake *Connection) 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 *Connection) Index(arg1 context.Context, arg2 *protocol.Index) error {
- fake.indexMutex.Lock()
- ret, specificReturn := fake.indexReturnsOnCall[len(fake.indexArgsForCall)]
- fake.indexArgsForCall = append(fake.indexArgsForCall, struct {
- arg1 context.Context
- arg2 *protocol.Index
- }{arg1, arg2})
- stub := fake.IndexStub
- fakeReturns := fake.indexReturns
- fake.recordInvocation("Index", []interface{}{arg1, arg2})
- fake.indexMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
- }
- func (fake *Connection) IndexCallCount() int {
- fake.indexMutex.RLock()
- defer fake.indexMutex.RUnlock()
- return len(fake.indexArgsForCall)
- }
- func (fake *Connection) IndexCalls(stub func(context.Context, *protocol.Index) error) {
- fake.indexMutex.Lock()
- defer fake.indexMutex.Unlock()
- fake.IndexStub = stub
- }
- func (fake *Connection) IndexArgsForCall(i int) (context.Context, *protocol.Index) {
- fake.indexMutex.RLock()
- defer fake.indexMutex.RUnlock()
- argsForCall := fake.indexArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
- }
- func (fake *Connection) IndexReturns(result1 error) {
- fake.indexMutex.Lock()
- defer fake.indexMutex.Unlock()
- fake.IndexStub = nil
- fake.indexReturns = struct {
- result1 error
- }{result1}
- }
- func (fake *Connection) IndexReturnsOnCall(i int, result1 error) {
- fake.indexMutex.Lock()
- defer fake.indexMutex.Unlock()
- fake.IndexStub = nil
- if fake.indexReturnsOnCall == nil {
- fake.indexReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.indexReturnsOnCall[i] = struct {
- result1 error
- }{result1}
- }
- func (fake *Connection) IndexUpdate(arg1 context.Context, arg2 *protocol.IndexUpdate) error {
- fake.indexUpdateMutex.Lock()
- ret, specificReturn := fake.indexUpdateReturnsOnCall[len(fake.indexUpdateArgsForCall)]
- fake.indexUpdateArgsForCall = append(fake.indexUpdateArgsForCall, struct {
- arg1 context.Context
- arg2 *protocol.IndexUpdate
- }{arg1, arg2})
- stub := fake.IndexUpdateStub
- fakeReturns := fake.indexUpdateReturns
- fake.recordInvocation("IndexUpdate", []interface{}{arg1, arg2})
- fake.indexUpdateMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
- }
- func (fake *Connection) IndexUpdateCallCount() int {
- fake.indexUpdateMutex.RLock()
- defer fake.indexUpdateMutex.RUnlock()
- return len(fake.indexUpdateArgsForCall)
- }
- func (fake *Connection) IndexUpdateCalls(stub func(context.Context, *protocol.IndexUpdate) error) {
- fake.indexUpdateMutex.Lock()
- defer fake.indexUpdateMutex.Unlock()
- fake.IndexUpdateStub = stub
- }
- func (fake *Connection) IndexUpdateArgsForCall(i int) (context.Context, *protocol.IndexUpdate) {
- fake.indexUpdateMutex.RLock()
- defer fake.indexUpdateMutex.RUnlock()
- argsForCall := fake.indexUpdateArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
- }
- func (fake *Connection) IndexUpdateReturns(result1 error) {
- fake.indexUpdateMutex.Lock()
- defer fake.indexUpdateMutex.Unlock()
- fake.IndexUpdateStub = nil
- fake.indexUpdateReturns = struct {
- result1 error
- }{result1}
- }
- func (fake *Connection) IndexUpdateReturnsOnCall(i int, result1 error) {
- fake.indexUpdateMutex.Lock()
- defer fake.indexUpdateMutex.Unlock()
- fake.IndexUpdateStub = nil
- if fake.indexUpdateReturnsOnCall == nil {
- fake.indexUpdateReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.indexUpdateReturnsOnCall[i] = struct {
- result1 error
- }{result1}
- }
- func (fake *Connection) 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 *Connection) IsLocalCallCount() int {
- fake.isLocalMutex.RLock()
- defer fake.isLocalMutex.RUnlock()
- return len(fake.isLocalArgsForCall)
- }
- func (fake *Connection) IsLocalCalls(stub func() bool) {
- fake.isLocalMutex.Lock()
- defer fake.isLocalMutex.Unlock()
- fake.IsLocalStub = stub
- }
- func (fake *Connection) IsLocalReturns(result1 bool) {
- fake.isLocalMutex.Lock()
- defer fake.isLocalMutex.Unlock()
- fake.IsLocalStub = nil
- fake.isLocalReturns = struct {
- result1 bool
- }{result1}
- }
- func (fake *Connection) 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 *Connection) 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 *Connection) PriorityCallCount() int {
- fake.priorityMutex.RLock()
- defer fake.priorityMutex.RUnlock()
- return len(fake.priorityArgsForCall)
- }
- func (fake *Connection) PriorityCalls(stub func() int) {
- fake.priorityMutex.Lock()
- defer fake.priorityMutex.Unlock()
- fake.PriorityStub = stub
- }
- func (fake *Connection) PriorityReturns(result1 int) {
- fake.priorityMutex.Lock()
- defer fake.priorityMutex.Unlock()
- fake.PriorityStub = nil
- fake.priorityReturns = struct {
- result1 int
- }{result1}
- }
- func (fake *Connection) 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 *Connection) 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 *Connection) RemoteAddrCallCount() int {
- fake.remoteAddrMutex.RLock()
- defer fake.remoteAddrMutex.RUnlock()
- return len(fake.remoteAddrArgsForCall)
- }
- func (fake *Connection) RemoteAddrCalls(stub func() net.Addr) {
- fake.remoteAddrMutex.Lock()
- defer fake.remoteAddrMutex.Unlock()
- fake.RemoteAddrStub = stub
- }
- func (fake *Connection) RemoteAddrReturns(result1 net.Addr) {
- fake.remoteAddrMutex.Lock()
- defer fake.remoteAddrMutex.Unlock()
- fake.RemoteAddrStub = nil
- fake.remoteAddrReturns = struct {
- result1 net.Addr
- }{result1}
- }
- func (fake *Connection) 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 *Connection) Request(arg1 context.Context, arg2 *protocol.Request) ([]byte, error) {
- fake.requestMutex.Lock()
- ret, specificReturn := fake.requestReturnsOnCall[len(fake.requestArgsForCall)]
- fake.requestArgsForCall = append(fake.requestArgsForCall, struct {
- arg1 context.Context
- arg2 *protocol.Request
- }{arg1, arg2})
- stub := fake.RequestStub
- fakeReturns := fake.requestReturns
- fake.recordInvocation("Request", []interface{}{arg1, arg2})
- fake.requestMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
- }
- func (fake *Connection) RequestCallCount() int {
- fake.requestMutex.RLock()
- defer fake.requestMutex.RUnlock()
- return len(fake.requestArgsForCall)
- }
- func (fake *Connection) RequestCalls(stub func(context.Context, *protocol.Request) ([]byte, error)) {
- fake.requestMutex.Lock()
- defer fake.requestMutex.Unlock()
- fake.RequestStub = stub
- }
- func (fake *Connection) RequestArgsForCall(i int) (context.Context, *protocol.Request) {
- fake.requestMutex.RLock()
- defer fake.requestMutex.RUnlock()
- argsForCall := fake.requestArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
- }
- func (fake *Connection) RequestReturns(result1 []byte, result2 error) {
- fake.requestMutex.Lock()
- defer fake.requestMutex.Unlock()
- fake.RequestStub = nil
- fake.requestReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
- }
- func (fake *Connection) RequestReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.requestMutex.Lock()
- defer fake.requestMutex.Unlock()
- fake.RequestStub = nil
- if fake.requestReturnsOnCall == nil {
- fake.requestReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.requestReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
- }
- func (fake *Connection) Start() {
- fake.startMutex.Lock()
- fake.startArgsForCall = append(fake.startArgsForCall, struct {
- }{})
- stub := fake.StartStub
- fake.recordInvocation("Start", []interface{}{})
- fake.startMutex.Unlock()
- if stub != nil {
- fake.StartStub()
- }
- }
- func (fake *Connection) StartCallCount() int {
- fake.startMutex.RLock()
- defer fake.startMutex.RUnlock()
- return len(fake.startArgsForCall)
- }
- func (fake *Connection) StartCalls(stub func()) {
- fake.startMutex.Lock()
- defer fake.startMutex.Unlock()
- fake.StartStub = stub
- }
- func (fake *Connection) Statistics() protocol.Statistics {
- fake.statisticsMutex.Lock()
- ret, specificReturn := fake.statisticsReturnsOnCall[len(fake.statisticsArgsForCall)]
- fake.statisticsArgsForCall = append(fake.statisticsArgsForCall, struct {
- }{})
- stub := fake.StatisticsStub
- fakeReturns := fake.statisticsReturns
- fake.recordInvocation("Statistics", []interface{}{})
- fake.statisticsMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
- }
- func (fake *Connection) StatisticsCallCount() int {
- fake.statisticsMutex.RLock()
- defer fake.statisticsMutex.RUnlock()
- return len(fake.statisticsArgsForCall)
- }
- func (fake *Connection) StatisticsCalls(stub func() protocol.Statistics) {
- fake.statisticsMutex.Lock()
- defer fake.statisticsMutex.Unlock()
- fake.StatisticsStub = stub
- }
- func (fake *Connection) StatisticsReturns(result1 protocol.Statistics) {
- fake.statisticsMutex.Lock()
- defer fake.statisticsMutex.Unlock()
- fake.StatisticsStub = nil
- fake.statisticsReturns = struct {
- result1 protocol.Statistics
- }{result1}
- }
- func (fake *Connection) StatisticsReturnsOnCall(i int, result1 protocol.Statistics) {
- fake.statisticsMutex.Lock()
- defer fake.statisticsMutex.Unlock()
- fake.StatisticsStub = nil
- if fake.statisticsReturnsOnCall == nil {
- fake.statisticsReturnsOnCall = make(map[int]struct {
- result1 protocol.Statistics
- })
- }
- fake.statisticsReturnsOnCall[i] = struct {
- result1 protocol.Statistics
- }{result1}
- }
- func (fake *Connection) 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 *Connection) StringCallCount() int {
- fake.stringMutex.RLock()
- defer fake.stringMutex.RUnlock()
- return len(fake.stringArgsForCall)
- }
- func (fake *Connection) StringCalls(stub func() string) {
- fake.stringMutex.Lock()
- defer fake.stringMutex.Unlock()
- fake.StringStub = stub
- }
- func (fake *Connection) StringReturns(result1 string) {
- fake.stringMutex.Lock()
- defer fake.stringMutex.Unlock()
- fake.StringStub = nil
- fake.stringReturns = struct {
- result1 string
- }{result1}
- }
- func (fake *Connection) 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 *Connection) 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 *Connection) TransportCallCount() int {
- fake.transportMutex.RLock()
- defer fake.transportMutex.RUnlock()
- return len(fake.transportArgsForCall)
- }
- func (fake *Connection) TransportCalls(stub func() string) {
- fake.transportMutex.Lock()
- defer fake.transportMutex.Unlock()
- fake.TransportStub = stub
- }
- func (fake *Connection) TransportReturns(result1 string) {
- fake.transportMutex.Lock()
- defer fake.transportMutex.Unlock()
- fake.TransportStub = nil
- fake.transportReturns = struct {
- result1 string
- }{result1}
- }
- func (fake *Connection) 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 *Connection) 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 *Connection) TypeCallCount() int {
- fake.typeMutex.RLock()
- defer fake.typeMutex.RUnlock()
- return len(fake.typeArgsForCall)
- }
- func (fake *Connection) TypeCalls(stub func() string) {
- fake.typeMutex.Lock()
- defer fake.typeMutex.Unlock()
- fake.TypeStub = stub
- }
- func (fake *Connection) TypeReturns(result1 string) {
- fake.typeMutex.Lock()
- defer fake.typeMutex.Unlock()
- fake.TypeStub = nil
- fake.typeReturns = struct {
- result1 string
- }{result1}
- }
- func (fake *Connection) 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 *Connection) 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 *Connection) 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.Connection = new(Connection)
|