mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
438 lines
12 KiB
Go
438 lines
12 KiB
Go
|
// Code generated by counterfeiter. DO NOT EDIT.
|
||
|
package mocks
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"sync"
|
||
|
|
||
|
"github.com/syncthing/syncthing/lib/connections"
|
||
|
)
|
||
|
|
||
|
type Service struct {
|
||
|
AllAddressesStub func() []string
|
||
|
allAddressesMutex sync.RWMutex
|
||
|
allAddressesArgsForCall []struct {
|
||
|
}
|
||
|
allAddressesReturns struct {
|
||
|
result1 []string
|
||
|
}
|
||
|
allAddressesReturnsOnCall map[int]struct {
|
||
|
result1 []string
|
||
|
}
|
||
|
ConnectionStatusStub func() map[string]connections.ConnectionStatusEntry
|
||
|
connectionStatusMutex sync.RWMutex
|
||
|
connectionStatusArgsForCall []struct {
|
||
|
}
|
||
|
connectionStatusReturns struct {
|
||
|
result1 map[string]connections.ConnectionStatusEntry
|
||
|
}
|
||
|
connectionStatusReturnsOnCall map[int]struct {
|
||
|
result1 map[string]connections.ConnectionStatusEntry
|
||
|
}
|
||
|
ExternalAddressesStub func() []string
|
||
|
externalAddressesMutex sync.RWMutex
|
||
|
externalAddressesArgsForCall []struct {
|
||
|
}
|
||
|
externalAddressesReturns struct {
|
||
|
result1 []string
|
||
|
}
|
||
|
externalAddressesReturnsOnCall map[int]struct {
|
||
|
result1 []string
|
||
|
}
|
||
|
ListenerStatusStub func() map[string]connections.ListenerStatusEntry
|
||
|
listenerStatusMutex sync.RWMutex
|
||
|
listenerStatusArgsForCall []struct {
|
||
|
}
|
||
|
listenerStatusReturns struct {
|
||
|
result1 map[string]connections.ListenerStatusEntry
|
||
|
}
|
||
|
listenerStatusReturnsOnCall map[int]struct {
|
||
|
result1 map[string]connections.ListenerStatusEntry
|
||
|
}
|
||
|
NATTypeStub func() string
|
||
|
nATTypeMutex sync.RWMutex
|
||
|
nATTypeArgsForCall []struct {
|
||
|
}
|
||
|
nATTypeReturns struct {
|
||
|
result1 string
|
||
|
}
|
||
|
nATTypeReturnsOnCall map[int]struct {
|
||
|
result1 string
|
||
|
}
|
||
|
ServeStub func(context.Context) error
|
||
|
serveMutex sync.RWMutex
|
||
|
serveArgsForCall []struct {
|
||
|
arg1 context.Context
|
||
|
}
|
||
|
serveReturns struct {
|
||
|
result1 error
|
||
|
}
|
||
|
serveReturnsOnCall map[int]struct {
|
||
|
result1 error
|
||
|
}
|
||
|
invocations map[string][][]interface{}
|
||
|
invocationsMutex sync.RWMutex
|
||
|
}
|
||
|
|
||
|
func (fake *Service) AllAddresses() []string {
|
||
|
fake.allAddressesMutex.Lock()
|
||
|
ret, specificReturn := fake.allAddressesReturnsOnCall[len(fake.allAddressesArgsForCall)]
|
||
|
fake.allAddressesArgsForCall = append(fake.allAddressesArgsForCall, struct {
|
||
|
}{})
|
||
|
stub := fake.AllAddressesStub
|
||
|
fakeReturns := fake.allAddressesReturns
|
||
|
fake.recordInvocation("AllAddresses", []interface{}{})
|
||
|
fake.allAddressesMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub()
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1
|
||
|
}
|
||
|
return fakeReturns.result1
|
||
|
}
|
||
|
|
||
|
func (fake *Service) AllAddressesCallCount() int {
|
||
|
fake.allAddressesMutex.RLock()
|
||
|
defer fake.allAddressesMutex.RUnlock()
|
||
|
return len(fake.allAddressesArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *Service) AllAddressesCalls(stub func() []string) {
|
||
|
fake.allAddressesMutex.Lock()
|
||
|
defer fake.allAddressesMutex.Unlock()
|
||
|
fake.AllAddressesStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *Service) AllAddressesReturns(result1 []string) {
|
||
|
fake.allAddressesMutex.Lock()
|
||
|
defer fake.allAddressesMutex.Unlock()
|
||
|
fake.AllAddressesStub = nil
|
||
|
fake.allAddressesReturns = struct {
|
||
|
result1 []string
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) AllAddressesReturnsOnCall(i int, result1 []string) {
|
||
|
fake.allAddressesMutex.Lock()
|
||
|
defer fake.allAddressesMutex.Unlock()
|
||
|
fake.AllAddressesStub = nil
|
||
|
if fake.allAddressesReturnsOnCall == nil {
|
||
|
fake.allAddressesReturnsOnCall = make(map[int]struct {
|
||
|
result1 []string
|
||
|
})
|
||
|
}
|
||
|
fake.allAddressesReturnsOnCall[i] = struct {
|
||
|
result1 []string
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ConnectionStatus() map[string]connections.ConnectionStatusEntry {
|
||
|
fake.connectionStatusMutex.Lock()
|
||
|
ret, specificReturn := fake.connectionStatusReturnsOnCall[len(fake.connectionStatusArgsForCall)]
|
||
|
fake.connectionStatusArgsForCall = append(fake.connectionStatusArgsForCall, struct {
|
||
|
}{})
|
||
|
stub := fake.ConnectionStatusStub
|
||
|
fakeReturns := fake.connectionStatusReturns
|
||
|
fake.recordInvocation("ConnectionStatus", []interface{}{})
|
||
|
fake.connectionStatusMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub()
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1
|
||
|
}
|
||
|
return fakeReturns.result1
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ConnectionStatusCallCount() int {
|
||
|
fake.connectionStatusMutex.RLock()
|
||
|
defer fake.connectionStatusMutex.RUnlock()
|
||
|
return len(fake.connectionStatusArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ConnectionStatusCalls(stub func() map[string]connections.ConnectionStatusEntry) {
|
||
|
fake.connectionStatusMutex.Lock()
|
||
|
defer fake.connectionStatusMutex.Unlock()
|
||
|
fake.ConnectionStatusStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ConnectionStatusReturns(result1 map[string]connections.ConnectionStatusEntry) {
|
||
|
fake.connectionStatusMutex.Lock()
|
||
|
defer fake.connectionStatusMutex.Unlock()
|
||
|
fake.ConnectionStatusStub = nil
|
||
|
fake.connectionStatusReturns = struct {
|
||
|
result1 map[string]connections.ConnectionStatusEntry
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ConnectionStatusReturnsOnCall(i int, result1 map[string]connections.ConnectionStatusEntry) {
|
||
|
fake.connectionStatusMutex.Lock()
|
||
|
defer fake.connectionStatusMutex.Unlock()
|
||
|
fake.ConnectionStatusStub = nil
|
||
|
if fake.connectionStatusReturnsOnCall == nil {
|
||
|
fake.connectionStatusReturnsOnCall = make(map[int]struct {
|
||
|
result1 map[string]connections.ConnectionStatusEntry
|
||
|
})
|
||
|
}
|
||
|
fake.connectionStatusReturnsOnCall[i] = struct {
|
||
|
result1 map[string]connections.ConnectionStatusEntry
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ExternalAddresses() []string {
|
||
|
fake.externalAddressesMutex.Lock()
|
||
|
ret, specificReturn := fake.externalAddressesReturnsOnCall[len(fake.externalAddressesArgsForCall)]
|
||
|
fake.externalAddressesArgsForCall = append(fake.externalAddressesArgsForCall, struct {
|
||
|
}{})
|
||
|
stub := fake.ExternalAddressesStub
|
||
|
fakeReturns := fake.externalAddressesReturns
|
||
|
fake.recordInvocation("ExternalAddresses", []interface{}{})
|
||
|
fake.externalAddressesMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub()
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1
|
||
|
}
|
||
|
return fakeReturns.result1
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ExternalAddressesCallCount() int {
|
||
|
fake.externalAddressesMutex.RLock()
|
||
|
defer fake.externalAddressesMutex.RUnlock()
|
||
|
return len(fake.externalAddressesArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ExternalAddressesCalls(stub func() []string) {
|
||
|
fake.externalAddressesMutex.Lock()
|
||
|
defer fake.externalAddressesMutex.Unlock()
|
||
|
fake.ExternalAddressesStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ExternalAddressesReturns(result1 []string) {
|
||
|
fake.externalAddressesMutex.Lock()
|
||
|
defer fake.externalAddressesMutex.Unlock()
|
||
|
fake.ExternalAddressesStub = nil
|
||
|
fake.externalAddressesReturns = struct {
|
||
|
result1 []string
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ExternalAddressesReturnsOnCall(i int, result1 []string) {
|
||
|
fake.externalAddressesMutex.Lock()
|
||
|
defer fake.externalAddressesMutex.Unlock()
|
||
|
fake.ExternalAddressesStub = nil
|
||
|
if fake.externalAddressesReturnsOnCall == nil {
|
||
|
fake.externalAddressesReturnsOnCall = make(map[int]struct {
|
||
|
result1 []string
|
||
|
})
|
||
|
}
|
||
|
fake.externalAddressesReturnsOnCall[i] = struct {
|
||
|
result1 []string
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ListenerStatus() map[string]connections.ListenerStatusEntry {
|
||
|
fake.listenerStatusMutex.Lock()
|
||
|
ret, specificReturn := fake.listenerStatusReturnsOnCall[len(fake.listenerStatusArgsForCall)]
|
||
|
fake.listenerStatusArgsForCall = append(fake.listenerStatusArgsForCall, struct {
|
||
|
}{})
|
||
|
stub := fake.ListenerStatusStub
|
||
|
fakeReturns := fake.listenerStatusReturns
|
||
|
fake.recordInvocation("ListenerStatus", []interface{}{})
|
||
|
fake.listenerStatusMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub()
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1
|
||
|
}
|
||
|
return fakeReturns.result1
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ListenerStatusCallCount() int {
|
||
|
fake.listenerStatusMutex.RLock()
|
||
|
defer fake.listenerStatusMutex.RUnlock()
|
||
|
return len(fake.listenerStatusArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ListenerStatusCalls(stub func() map[string]connections.ListenerStatusEntry) {
|
||
|
fake.listenerStatusMutex.Lock()
|
||
|
defer fake.listenerStatusMutex.Unlock()
|
||
|
fake.ListenerStatusStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ListenerStatusReturns(result1 map[string]connections.ListenerStatusEntry) {
|
||
|
fake.listenerStatusMutex.Lock()
|
||
|
defer fake.listenerStatusMutex.Unlock()
|
||
|
fake.ListenerStatusStub = nil
|
||
|
fake.listenerStatusReturns = struct {
|
||
|
result1 map[string]connections.ListenerStatusEntry
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ListenerStatusReturnsOnCall(i int, result1 map[string]connections.ListenerStatusEntry) {
|
||
|
fake.listenerStatusMutex.Lock()
|
||
|
defer fake.listenerStatusMutex.Unlock()
|
||
|
fake.ListenerStatusStub = nil
|
||
|
if fake.listenerStatusReturnsOnCall == nil {
|
||
|
fake.listenerStatusReturnsOnCall = make(map[int]struct {
|
||
|
result1 map[string]connections.ListenerStatusEntry
|
||
|
})
|
||
|
}
|
||
|
fake.listenerStatusReturnsOnCall[i] = struct {
|
||
|
result1 map[string]connections.ListenerStatusEntry
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) NATType() string {
|
||
|
fake.nATTypeMutex.Lock()
|
||
|
ret, specificReturn := fake.nATTypeReturnsOnCall[len(fake.nATTypeArgsForCall)]
|
||
|
fake.nATTypeArgsForCall = append(fake.nATTypeArgsForCall, struct {
|
||
|
}{})
|
||
|
stub := fake.NATTypeStub
|
||
|
fakeReturns := fake.nATTypeReturns
|
||
|
fake.recordInvocation("NATType", []interface{}{})
|
||
|
fake.nATTypeMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub()
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1
|
||
|
}
|
||
|
return fakeReturns.result1
|
||
|
}
|
||
|
|
||
|
func (fake *Service) NATTypeCallCount() int {
|
||
|
fake.nATTypeMutex.RLock()
|
||
|
defer fake.nATTypeMutex.RUnlock()
|
||
|
return len(fake.nATTypeArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *Service) NATTypeCalls(stub func() string) {
|
||
|
fake.nATTypeMutex.Lock()
|
||
|
defer fake.nATTypeMutex.Unlock()
|
||
|
fake.NATTypeStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *Service) NATTypeReturns(result1 string) {
|
||
|
fake.nATTypeMutex.Lock()
|
||
|
defer fake.nATTypeMutex.Unlock()
|
||
|
fake.NATTypeStub = nil
|
||
|
fake.nATTypeReturns = struct {
|
||
|
result1 string
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) NATTypeReturnsOnCall(i int, result1 string) {
|
||
|
fake.nATTypeMutex.Lock()
|
||
|
defer fake.nATTypeMutex.Unlock()
|
||
|
fake.NATTypeStub = nil
|
||
|
if fake.nATTypeReturnsOnCall == nil {
|
||
|
fake.nATTypeReturnsOnCall = make(map[int]struct {
|
||
|
result1 string
|
||
|
})
|
||
|
}
|
||
|
fake.nATTypeReturnsOnCall[i] = struct {
|
||
|
result1 string
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) Serve(arg1 context.Context) error {
|
||
|
fake.serveMutex.Lock()
|
||
|
ret, specificReturn := fake.serveReturnsOnCall[len(fake.serveArgsForCall)]
|
||
|
fake.serveArgsForCall = append(fake.serveArgsForCall, struct {
|
||
|
arg1 context.Context
|
||
|
}{arg1})
|
||
|
stub := fake.ServeStub
|
||
|
fakeReturns := fake.serveReturns
|
||
|
fake.recordInvocation("Serve", []interface{}{arg1})
|
||
|
fake.serveMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub(arg1)
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1
|
||
|
}
|
||
|
return fakeReturns.result1
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ServeCallCount() int {
|
||
|
fake.serveMutex.RLock()
|
||
|
defer fake.serveMutex.RUnlock()
|
||
|
return len(fake.serveArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ServeCalls(stub func(context.Context) error) {
|
||
|
fake.serveMutex.Lock()
|
||
|
defer fake.serveMutex.Unlock()
|
||
|
fake.ServeStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ServeArgsForCall(i int) context.Context {
|
||
|
fake.serveMutex.RLock()
|
||
|
defer fake.serveMutex.RUnlock()
|
||
|
argsForCall := fake.serveArgsForCall[i]
|
||
|
return argsForCall.arg1
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ServeReturns(result1 error) {
|
||
|
fake.serveMutex.Lock()
|
||
|
defer fake.serveMutex.Unlock()
|
||
|
fake.ServeStub = nil
|
||
|
fake.serveReturns = struct {
|
||
|
result1 error
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) ServeReturnsOnCall(i int, result1 error) {
|
||
|
fake.serveMutex.Lock()
|
||
|
defer fake.serveMutex.Unlock()
|
||
|
fake.ServeStub = nil
|
||
|
if fake.serveReturnsOnCall == nil {
|
||
|
fake.serveReturnsOnCall = make(map[int]struct {
|
||
|
result1 error
|
||
|
})
|
||
|
}
|
||
|
fake.serveReturnsOnCall[i] = struct {
|
||
|
result1 error
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *Service) Invocations() map[string][][]interface{} {
|
||
|
fake.invocationsMutex.RLock()
|
||
|
defer fake.invocationsMutex.RUnlock()
|
||
|
fake.allAddressesMutex.RLock()
|
||
|
defer fake.allAddressesMutex.RUnlock()
|
||
|
fake.connectionStatusMutex.RLock()
|
||
|
defer fake.connectionStatusMutex.RUnlock()
|
||
|
fake.externalAddressesMutex.RLock()
|
||
|
defer fake.externalAddressesMutex.RUnlock()
|
||
|
fake.listenerStatusMutex.RLock()
|
||
|
defer fake.listenerStatusMutex.RUnlock()
|
||
|
fake.nATTypeMutex.RLock()
|
||
|
defer fake.nATTypeMutex.RUnlock()
|
||
|
fake.serveMutex.RLock()
|
||
|
defer fake.serveMutex.RUnlock()
|
||
|
copiedInvocations := map[string][][]interface{}{}
|
||
|
for key, value := range fake.invocations {
|
||
|
copiedInvocations[key] = value
|
||
|
}
|
||
|
return copiedInvocations
|
||
|
}
|
||
|
|
||
|
func (fake *Service) 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 _ connections.Service = new(Service)
|