go-ssb-room/roomdb/mockdb/auth_fallback.go

205 lines
5.4 KiB
Go

// Code generated by counterfeiter. DO NOT EDIT.
package mockdb
import (
"context"
"sync"
"github.com/ssb-ngi-pointer/go-ssb-room/roomdb"
)
type FakeAuthFallbackService struct {
CheckStub func(string, string) (interface{}, error)
checkMutex sync.RWMutex
checkArgsForCall []struct {
arg1 string
arg2 string
}
checkReturns struct {
result1 interface{}
result2 error
}
checkReturnsOnCall map[int]struct {
result1 interface{}
result2 error
}
CreateStub func(context.Context, int64, string, []byte) error
createMutex sync.RWMutex
createArgsForCall []struct {
arg1 context.Context
arg2 int64
arg3 string
arg4 []byte
}
createReturns struct {
result1 error
}
createReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeAuthFallbackService) Check(arg1 string, arg2 string) (interface{}, error) {
fake.checkMutex.Lock()
ret, specificReturn := fake.checkReturnsOnCall[len(fake.checkArgsForCall)]
fake.checkArgsForCall = append(fake.checkArgsForCall, struct {
arg1 string
arg2 string
}{arg1, arg2})
stub := fake.CheckStub
fakeReturns := fake.checkReturns
fake.recordInvocation("Check", []interface{}{arg1, arg2})
fake.checkMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeAuthFallbackService) CheckCallCount() int {
fake.checkMutex.RLock()
defer fake.checkMutex.RUnlock()
return len(fake.checkArgsForCall)
}
func (fake *FakeAuthFallbackService) CheckCalls(stub func(string, string) (interface{}, error)) {
fake.checkMutex.Lock()
defer fake.checkMutex.Unlock()
fake.CheckStub = stub
}
func (fake *FakeAuthFallbackService) CheckArgsForCall(i int) (string, string) {
fake.checkMutex.RLock()
defer fake.checkMutex.RUnlock()
argsForCall := fake.checkArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeAuthFallbackService) CheckReturns(result1 interface{}, result2 error) {
fake.checkMutex.Lock()
defer fake.checkMutex.Unlock()
fake.CheckStub = nil
fake.checkReturns = struct {
result1 interface{}
result2 error
}{result1, result2}
}
func (fake *FakeAuthFallbackService) CheckReturnsOnCall(i int, result1 interface{}, result2 error) {
fake.checkMutex.Lock()
defer fake.checkMutex.Unlock()
fake.CheckStub = nil
if fake.checkReturnsOnCall == nil {
fake.checkReturnsOnCall = make(map[int]struct {
result1 interface{}
result2 error
})
}
fake.checkReturnsOnCall[i] = struct {
result1 interface{}
result2 error
}{result1, result2}
}
func (fake *FakeAuthFallbackService) Create(arg1 context.Context, arg2 int64, arg3 string, arg4 []byte) error {
var arg4Copy []byte
if arg4 != nil {
arg4Copy = make([]byte, len(arg4))
copy(arg4Copy, arg4)
}
fake.createMutex.Lock()
ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
fake.createArgsForCall = append(fake.createArgsForCall, struct {
arg1 context.Context
arg2 int64
arg3 string
arg4 []byte
}{arg1, arg2, arg3, arg4Copy})
stub := fake.CreateStub
fakeReturns := fake.createReturns
fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3, arg4Copy})
fake.createMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3, arg4)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeAuthFallbackService) CreateCallCount() int {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return len(fake.createArgsForCall)
}
func (fake *FakeAuthFallbackService) CreateCalls(stub func(context.Context, int64, string, []byte) error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = stub
}
func (fake *FakeAuthFallbackService) CreateArgsForCall(i int) (context.Context, int64, string, []byte) {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
argsForCall := fake.createArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}
func (fake *FakeAuthFallbackService) CreateReturns(result1 error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = nil
fake.createReturns = struct {
result1 error
}{result1}
}
func (fake *FakeAuthFallbackService) CreateReturnsOnCall(i int, result1 error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = nil
if fake.createReturnsOnCall == nil {
fake.createReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.createReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeAuthFallbackService) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.checkMutex.RLock()
defer fake.checkMutex.RUnlock()
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeAuthFallbackService) 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 _ roomdb.AuthFallbackService = new(FakeAuthFallbackService)