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

289 lines
7.8 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, string, []byte) (int64, error)
createMutex sync.RWMutex
createArgsForCall []struct {
arg1 context.Context
arg2 string
arg3 []byte
}
createReturns struct {
result1 int64
result2 error
}
createReturnsOnCall map[int]struct {
result1 int64
result2 error
}
GetByIDStub func(context.Context, int64) (*roomdb.User, error)
getByIDMutex sync.RWMutex
getByIDArgsForCall []struct {
arg1 context.Context
arg2 int64
}
getByIDReturns struct {
result1 *roomdb.User
result2 error
}
getByIDReturnsOnCall map[int]struct {
result1 *roomdb.User
result2 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 string, arg3 []byte) (int64, error) {
var arg3Copy []byte
if arg3 != nil {
arg3Copy = make([]byte, len(arg3))
copy(arg3Copy, arg3)
}
fake.createMutex.Lock()
ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
fake.createArgsForCall = append(fake.createArgsForCall, struct {
arg1 context.Context
arg2 string
arg3 []byte
}{arg1, arg2, arg3Copy})
stub := fake.CreateStub
fakeReturns := fake.createReturns
fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3Copy})
fake.createMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeAuthFallbackService) CreateCallCount() int {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return len(fake.createArgsForCall)
}
func (fake *FakeAuthFallbackService) CreateCalls(stub func(context.Context, string, []byte) (int64, error)) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = stub
}
func (fake *FakeAuthFallbackService) CreateArgsForCall(i int) (context.Context, string, []byte) {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
argsForCall := fake.createArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *FakeAuthFallbackService) CreateReturns(result1 int64, result2 error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = nil
fake.createReturns = struct {
result1 int64
result2 error
}{result1, result2}
}
func (fake *FakeAuthFallbackService) CreateReturnsOnCall(i int, result1 int64, result2 error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = nil
if fake.createReturnsOnCall == nil {
fake.createReturnsOnCall = make(map[int]struct {
result1 int64
result2 error
})
}
fake.createReturnsOnCall[i] = struct {
result1 int64
result2 error
}{result1, result2}
}
func (fake *FakeAuthFallbackService) GetByID(arg1 context.Context, arg2 int64) (*roomdb.User, error) {
fake.getByIDMutex.Lock()
ret, specificReturn := fake.getByIDReturnsOnCall[len(fake.getByIDArgsForCall)]
fake.getByIDArgsForCall = append(fake.getByIDArgsForCall, struct {
arg1 context.Context
arg2 int64
}{arg1, arg2})
stub := fake.GetByIDStub
fakeReturns := fake.getByIDReturns
fake.recordInvocation("GetByID", []interface{}{arg1, arg2})
fake.getByIDMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeAuthFallbackService) GetByIDCallCount() int {
fake.getByIDMutex.RLock()
defer fake.getByIDMutex.RUnlock()
return len(fake.getByIDArgsForCall)
}
func (fake *FakeAuthFallbackService) GetByIDCalls(stub func(context.Context, int64) (*roomdb.User, error)) {
fake.getByIDMutex.Lock()
defer fake.getByIDMutex.Unlock()
fake.GetByIDStub = stub
}
func (fake *FakeAuthFallbackService) GetByIDArgsForCall(i int) (context.Context, int64) {
fake.getByIDMutex.RLock()
defer fake.getByIDMutex.RUnlock()
argsForCall := fake.getByIDArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeAuthFallbackService) GetByIDReturns(result1 *roomdb.User, result2 error) {
fake.getByIDMutex.Lock()
defer fake.getByIDMutex.Unlock()
fake.GetByIDStub = nil
fake.getByIDReturns = struct {
result1 *roomdb.User
result2 error
}{result1, result2}
}
func (fake *FakeAuthFallbackService) GetByIDReturnsOnCall(i int, result1 *roomdb.User, result2 error) {
fake.getByIDMutex.Lock()
defer fake.getByIDMutex.Unlock()
fake.GetByIDStub = nil
if fake.getByIDReturnsOnCall == nil {
fake.getByIDReturnsOnCall = make(map[int]struct {
result1 *roomdb.User
result2 error
})
}
fake.getByIDReturnsOnCall[i] = struct {
result1 *roomdb.User
result2 error
}{result1, result2}
}
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()
fake.getByIDMutex.RLock()
defer fake.getByIDMutex.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)