srs/internal/proxy/proxyfakes/fake_http_api_proxy_server.go

173 lines
4.1 KiB
Go

// Code generated by counterfeiter. DO NOT EDIT.
package proxyfakes
import (
"context"
"srsx/internal/proxy"
"sync"
)
type FakeHTTPAPIProxyServer struct {
CloseStub func() error
closeMutex sync.RWMutex
closeArgsForCall []struct {
}
closeReturns struct {
result1 error
}
closeReturnsOnCall map[int]struct {
result1 error
}
RunStub func(context.Context) error
runMutex sync.RWMutex
runArgsForCall []struct {
arg1 context.Context
}
runReturns struct {
result1 error
}
runReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeHTTPAPIProxyServer) Close() error {
fake.closeMutex.Lock()
ret, specificReturn := fake.closeReturnsOnCall[len(fake.closeArgsForCall)]
fake.closeArgsForCall = append(fake.closeArgsForCall, struct {
}{})
stub := fake.CloseStub
fakeReturns := fake.closeReturns
fake.recordInvocation("Close", []interface{}{})
fake.closeMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeHTTPAPIProxyServer) CloseCallCount() int {
fake.closeMutex.RLock()
defer fake.closeMutex.RUnlock()
return len(fake.closeArgsForCall)
}
func (fake *FakeHTTPAPIProxyServer) CloseCalls(stub func() error) {
fake.closeMutex.Lock()
defer fake.closeMutex.Unlock()
fake.CloseStub = stub
}
func (fake *FakeHTTPAPIProxyServer) CloseReturns(result1 error) {
fake.closeMutex.Lock()
defer fake.closeMutex.Unlock()
fake.CloseStub = nil
fake.closeReturns = struct {
result1 error
}{result1}
}
func (fake *FakeHTTPAPIProxyServer) CloseReturnsOnCall(i int, result1 error) {
fake.closeMutex.Lock()
defer fake.closeMutex.Unlock()
fake.CloseStub = nil
if fake.closeReturnsOnCall == nil {
fake.closeReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.closeReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeHTTPAPIProxyServer) Run(arg1 context.Context) error {
fake.runMutex.Lock()
ret, specificReturn := fake.runReturnsOnCall[len(fake.runArgsForCall)]
fake.runArgsForCall = append(fake.runArgsForCall, struct {
arg1 context.Context
}{arg1})
stub := fake.RunStub
fakeReturns := fake.runReturns
fake.recordInvocation("Run", []interface{}{arg1})
fake.runMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeHTTPAPIProxyServer) RunCallCount() int {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
return len(fake.runArgsForCall)
}
func (fake *FakeHTTPAPIProxyServer) RunCalls(stub func(context.Context) error) {
fake.runMutex.Lock()
defer fake.runMutex.Unlock()
fake.RunStub = stub
}
func (fake *FakeHTTPAPIProxyServer) RunArgsForCall(i int) context.Context {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
argsForCall := fake.runArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeHTTPAPIProxyServer) RunReturns(result1 error) {
fake.runMutex.Lock()
defer fake.runMutex.Unlock()
fake.RunStub = nil
fake.runReturns = struct {
result1 error
}{result1}
}
func (fake *FakeHTTPAPIProxyServer) RunReturnsOnCall(i int, result1 error) {
fake.runMutex.Lock()
defer fake.runMutex.Unlock()
fake.RunStub = nil
if fake.runReturnsOnCall == nil {
fake.runReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.runReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeHTTPAPIProxyServer) 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 *FakeHTTPAPIProxyServer) 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 _ proxy.HTTPAPIProxyServer = new(FakeHTTPAPIProxyServer)