361 lines
9.6 KiB
Go
361 lines
9.6 KiB
Go
|
// Code generated by counterfeiter. DO NOT EDIT.
|
||
|
package mockdb
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"sync"
|
||
|
|
||
|
"github.com/ssb-ngi-pointer/go-ssb-room/admindb"
|
||
|
refs "go.mindeco.de/ssb-refs"
|
||
|
)
|
||
|
|
||
|
type FakeInviteService struct {
|
||
|
ConsumeStub func(context.Context, string, refs.FeedRef) (admindb.Invite, error)
|
||
|
consumeMutex sync.RWMutex
|
||
|
consumeArgsForCall []struct {
|
||
|
arg1 context.Context
|
||
|
arg2 string
|
||
|
arg3 refs.FeedRef
|
||
|
}
|
||
|
consumeReturns struct {
|
||
|
result1 admindb.Invite
|
||
|
result2 error
|
||
|
}
|
||
|
consumeReturnsOnCall map[int]struct {
|
||
|
result1 admindb.Invite
|
||
|
result2 error
|
||
|
}
|
||
|
CreateStub func(context.Context, int64, string) (string, error)
|
||
|
createMutex sync.RWMutex
|
||
|
createArgsForCall []struct {
|
||
|
arg1 context.Context
|
||
|
arg2 int64
|
||
|
arg3 string
|
||
|
}
|
||
|
createReturns struct {
|
||
|
result1 string
|
||
|
result2 error
|
||
|
}
|
||
|
createReturnsOnCall map[int]struct {
|
||
|
result1 string
|
||
|
result2 error
|
||
|
}
|
||
|
ListStub func(context.Context) ([]admindb.Invite, error)
|
||
|
listMutex sync.RWMutex
|
||
|
listArgsForCall []struct {
|
||
|
arg1 context.Context
|
||
|
}
|
||
|
listReturns struct {
|
||
|
result1 []admindb.Invite
|
||
|
result2 error
|
||
|
}
|
||
|
listReturnsOnCall map[int]struct {
|
||
|
result1 []admindb.Invite
|
||
|
result2 error
|
||
|
}
|
||
|
RevokeStub func(context.Context, int64) error
|
||
|
revokeMutex sync.RWMutex
|
||
|
revokeArgsForCall []struct {
|
||
|
arg1 context.Context
|
||
|
arg2 int64
|
||
|
}
|
||
|
revokeReturns struct {
|
||
|
result1 error
|
||
|
}
|
||
|
revokeReturnsOnCall map[int]struct {
|
||
|
result1 error
|
||
|
}
|
||
|
invocations map[string][][]interface{}
|
||
|
invocationsMutex sync.RWMutex
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) Consume(arg1 context.Context, arg2 string, arg3 refs.FeedRef) (admindb.Invite, error) {
|
||
|
fake.consumeMutex.Lock()
|
||
|
ret, specificReturn := fake.consumeReturnsOnCall[len(fake.consumeArgsForCall)]
|
||
|
fake.consumeArgsForCall = append(fake.consumeArgsForCall, struct {
|
||
|
arg1 context.Context
|
||
|
arg2 string
|
||
|
arg3 refs.FeedRef
|
||
|
}{arg1, arg2, arg3})
|
||
|
stub := fake.ConsumeStub
|
||
|
fakeReturns := fake.consumeReturns
|
||
|
fake.recordInvocation("Consume", []interface{}{arg1, arg2, arg3})
|
||
|
fake.consumeMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub(arg1, arg2, arg3)
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1, ret.result2
|
||
|
}
|
||
|
return fakeReturns.result1, fakeReturns.result2
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ConsumeCallCount() int {
|
||
|
fake.consumeMutex.RLock()
|
||
|
defer fake.consumeMutex.RUnlock()
|
||
|
return len(fake.consumeArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ConsumeCalls(stub func(context.Context, string, refs.FeedRef) (admindb.Invite, error)) {
|
||
|
fake.consumeMutex.Lock()
|
||
|
defer fake.consumeMutex.Unlock()
|
||
|
fake.ConsumeStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ConsumeArgsForCall(i int) (context.Context, string, refs.FeedRef) {
|
||
|
fake.consumeMutex.RLock()
|
||
|
defer fake.consumeMutex.RUnlock()
|
||
|
argsForCall := fake.consumeArgsForCall[i]
|
||
|
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ConsumeReturns(result1 admindb.Invite, result2 error) {
|
||
|
fake.consumeMutex.Lock()
|
||
|
defer fake.consumeMutex.Unlock()
|
||
|
fake.ConsumeStub = nil
|
||
|
fake.consumeReturns = struct {
|
||
|
result1 admindb.Invite
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ConsumeReturnsOnCall(i int, result1 admindb.Invite, result2 error) {
|
||
|
fake.consumeMutex.Lock()
|
||
|
defer fake.consumeMutex.Unlock()
|
||
|
fake.ConsumeStub = nil
|
||
|
if fake.consumeReturnsOnCall == nil {
|
||
|
fake.consumeReturnsOnCall = make(map[int]struct {
|
||
|
result1 admindb.Invite
|
||
|
result2 error
|
||
|
})
|
||
|
}
|
||
|
fake.consumeReturnsOnCall[i] = struct {
|
||
|
result1 admindb.Invite
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) Create(arg1 context.Context, arg2 int64, arg3 string) (string, error) {
|
||
|
fake.createMutex.Lock()
|
||
|
ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
|
||
|
fake.createArgsForCall = append(fake.createArgsForCall, struct {
|
||
|
arg1 context.Context
|
||
|
arg2 int64
|
||
|
arg3 string
|
||
|
}{arg1, arg2, arg3})
|
||
|
stub := fake.CreateStub
|
||
|
fakeReturns := fake.createReturns
|
||
|
fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3})
|
||
|
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 *FakeInviteService) CreateCallCount() int {
|
||
|
fake.createMutex.RLock()
|
||
|
defer fake.createMutex.RUnlock()
|
||
|
return len(fake.createArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) CreateCalls(stub func(context.Context, int64, string) (string, error)) {
|
||
|
fake.createMutex.Lock()
|
||
|
defer fake.createMutex.Unlock()
|
||
|
fake.CreateStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) CreateArgsForCall(i int) (context.Context, int64, string) {
|
||
|
fake.createMutex.RLock()
|
||
|
defer fake.createMutex.RUnlock()
|
||
|
argsForCall := fake.createArgsForCall[i]
|
||
|
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) CreateReturns(result1 string, result2 error) {
|
||
|
fake.createMutex.Lock()
|
||
|
defer fake.createMutex.Unlock()
|
||
|
fake.CreateStub = nil
|
||
|
fake.createReturns = struct {
|
||
|
result1 string
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) CreateReturnsOnCall(i int, result1 string, result2 error) {
|
||
|
fake.createMutex.Lock()
|
||
|
defer fake.createMutex.Unlock()
|
||
|
fake.CreateStub = nil
|
||
|
if fake.createReturnsOnCall == nil {
|
||
|
fake.createReturnsOnCall = make(map[int]struct {
|
||
|
result1 string
|
||
|
result2 error
|
||
|
})
|
||
|
}
|
||
|
fake.createReturnsOnCall[i] = struct {
|
||
|
result1 string
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) List(arg1 context.Context) ([]admindb.Invite, error) {
|
||
|
fake.listMutex.Lock()
|
||
|
ret, specificReturn := fake.listReturnsOnCall[len(fake.listArgsForCall)]
|
||
|
fake.listArgsForCall = append(fake.listArgsForCall, struct {
|
||
|
arg1 context.Context
|
||
|
}{arg1})
|
||
|
stub := fake.ListStub
|
||
|
fakeReturns := fake.listReturns
|
||
|
fake.recordInvocation("List", []interface{}{arg1})
|
||
|
fake.listMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub(arg1)
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1, ret.result2
|
||
|
}
|
||
|
return fakeReturns.result1, fakeReturns.result2
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ListCallCount() int {
|
||
|
fake.listMutex.RLock()
|
||
|
defer fake.listMutex.RUnlock()
|
||
|
return len(fake.listArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ListCalls(stub func(context.Context) ([]admindb.Invite, error)) {
|
||
|
fake.listMutex.Lock()
|
||
|
defer fake.listMutex.Unlock()
|
||
|
fake.ListStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ListArgsForCall(i int) context.Context {
|
||
|
fake.listMutex.RLock()
|
||
|
defer fake.listMutex.RUnlock()
|
||
|
argsForCall := fake.listArgsForCall[i]
|
||
|
return argsForCall.arg1
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ListReturns(result1 []admindb.Invite, result2 error) {
|
||
|
fake.listMutex.Lock()
|
||
|
defer fake.listMutex.Unlock()
|
||
|
fake.ListStub = nil
|
||
|
fake.listReturns = struct {
|
||
|
result1 []admindb.Invite
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) ListReturnsOnCall(i int, result1 []admindb.Invite, result2 error) {
|
||
|
fake.listMutex.Lock()
|
||
|
defer fake.listMutex.Unlock()
|
||
|
fake.ListStub = nil
|
||
|
if fake.listReturnsOnCall == nil {
|
||
|
fake.listReturnsOnCall = make(map[int]struct {
|
||
|
result1 []admindb.Invite
|
||
|
result2 error
|
||
|
})
|
||
|
}
|
||
|
fake.listReturnsOnCall[i] = struct {
|
||
|
result1 []admindb.Invite
|
||
|
result2 error
|
||
|
}{result1, result2}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) Revoke(arg1 context.Context, arg2 int64) error {
|
||
|
fake.revokeMutex.Lock()
|
||
|
ret, specificReturn := fake.revokeReturnsOnCall[len(fake.revokeArgsForCall)]
|
||
|
fake.revokeArgsForCall = append(fake.revokeArgsForCall, struct {
|
||
|
arg1 context.Context
|
||
|
arg2 int64
|
||
|
}{arg1, arg2})
|
||
|
stub := fake.RevokeStub
|
||
|
fakeReturns := fake.revokeReturns
|
||
|
fake.recordInvocation("Revoke", []interface{}{arg1, arg2})
|
||
|
fake.revokeMutex.Unlock()
|
||
|
if stub != nil {
|
||
|
return stub(arg1, arg2)
|
||
|
}
|
||
|
if specificReturn {
|
||
|
return ret.result1
|
||
|
}
|
||
|
return fakeReturns.result1
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) RevokeCallCount() int {
|
||
|
fake.revokeMutex.RLock()
|
||
|
defer fake.revokeMutex.RUnlock()
|
||
|
return len(fake.revokeArgsForCall)
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) RevokeCalls(stub func(context.Context, int64) error) {
|
||
|
fake.revokeMutex.Lock()
|
||
|
defer fake.revokeMutex.Unlock()
|
||
|
fake.RevokeStub = stub
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) RevokeArgsForCall(i int) (context.Context, int64) {
|
||
|
fake.revokeMutex.RLock()
|
||
|
defer fake.revokeMutex.RUnlock()
|
||
|
argsForCall := fake.revokeArgsForCall[i]
|
||
|
return argsForCall.arg1, argsForCall.arg2
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) RevokeReturns(result1 error) {
|
||
|
fake.revokeMutex.Lock()
|
||
|
defer fake.revokeMutex.Unlock()
|
||
|
fake.RevokeStub = nil
|
||
|
fake.revokeReturns = struct {
|
||
|
result1 error
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) RevokeReturnsOnCall(i int, result1 error) {
|
||
|
fake.revokeMutex.Lock()
|
||
|
defer fake.revokeMutex.Unlock()
|
||
|
fake.RevokeStub = nil
|
||
|
if fake.revokeReturnsOnCall == nil {
|
||
|
fake.revokeReturnsOnCall = make(map[int]struct {
|
||
|
result1 error
|
||
|
})
|
||
|
}
|
||
|
fake.revokeReturnsOnCall[i] = struct {
|
||
|
result1 error
|
||
|
}{result1}
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) Invocations() map[string][][]interface{} {
|
||
|
fake.invocationsMutex.RLock()
|
||
|
defer fake.invocationsMutex.RUnlock()
|
||
|
fake.consumeMutex.RLock()
|
||
|
defer fake.consumeMutex.RUnlock()
|
||
|
fake.createMutex.RLock()
|
||
|
defer fake.createMutex.RUnlock()
|
||
|
fake.listMutex.RLock()
|
||
|
defer fake.listMutex.RUnlock()
|
||
|
fake.revokeMutex.RLock()
|
||
|
defer fake.revokeMutex.RUnlock()
|
||
|
copiedInvocations := map[string][][]interface{}{}
|
||
|
for key, value := range fake.invocations {
|
||
|
copiedInvocations[key] = value
|
||
|
}
|
||
|
return copiedInvocations
|
||
|
}
|
||
|
|
||
|
func (fake *FakeInviteService) 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 _ admindb.InviteService = new(FakeInviteService)
|