go generate

This commit is contained in:
Henry 2021-02-09 12:44:12 +01:00
parent 743de1d1f6
commit 40f73b5930
2 changed files with 106 additions and 22 deletions

View File

@ -2,6 +2,7 @@
package mockdb
import (
"context"
"sync"
"github.com/ssb-ngi-pointer/gossb-rooms/admindb"
@ -22,11 +23,12 @@ type FakeAuthFallbackService struct {
result1 interface{}
result2 error
}
CreateStub func(string, []byte) error
CreateStub func(context.Context, string, []byte) error
createMutex sync.RWMutex
createArgsForCall []struct {
arg1 string
arg2 []byte
arg1 context.Context
arg2 string
arg3 []byte
}
createReturns struct {
result1 error
@ -34,6 +36,20 @@ type FakeAuthFallbackService struct {
createReturnsOnCall map[int]struct {
result1 error
}
GetByIDStub func(context.Context, int64) (*admindb.User, error)
getByIDMutex sync.RWMutex
getByIDArgsForCall []struct {
arg1 context.Context
arg2 int64
}
getByIDReturns struct {
result1 *admindb.User
result2 error
}
getByIDReturnsOnCall map[int]struct {
result1 *admindb.User
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
@ -103,24 +119,25 @@ func (fake *FakeAuthFallbackService) CheckReturnsOnCall(i int, result1 interface
}{result1, result2}
}
func (fake *FakeAuthFallbackService) Create(arg1 string, arg2 []byte) error {
var arg2Copy []byte
if arg2 != nil {
arg2Copy = make([]byte, len(arg2))
copy(arg2Copy, arg2)
func (fake *FakeAuthFallbackService) Create(arg1 context.Context, arg2 string, arg3 []byte) 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 string
arg2 []byte
}{arg1, arg2Copy})
arg1 context.Context
arg2 string
arg3 []byte
}{arg1, arg2, arg3Copy})
stub := fake.CreateStub
fakeReturns := fake.createReturns
fake.recordInvocation("Create", []interface{}{arg1, arg2Copy})
fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3Copy})
fake.createMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
return stub(arg1, arg2, arg3)
}
if specificReturn {
return ret.result1
@ -134,17 +151,17 @@ func (fake *FakeAuthFallbackService) CreateCallCount() int {
return len(fake.createArgsForCall)
}
func (fake *FakeAuthFallbackService) CreateCalls(stub func(string, []byte) error) {
func (fake *FakeAuthFallbackService) CreateCalls(stub func(context.Context, string, []byte) error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = stub
}
func (fake *FakeAuthFallbackService) CreateArgsForCall(i int) (string, []byte) {
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
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *FakeAuthFallbackService) CreateReturns(result1 error) {
@ -170,6 +187,71 @@ func (fake *FakeAuthFallbackService) CreateReturnsOnCall(i int, result1 error) {
}{result1}
}
func (fake *FakeAuthFallbackService) GetByID(arg1 context.Context, arg2 int64) (*admindb.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) (*admindb.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 *admindb.User, result2 error) {
fake.getByIDMutex.Lock()
defer fake.getByIDMutex.Unlock()
fake.GetByIDStub = nil
fake.getByIDReturns = struct {
result1 *admindb.User
result2 error
}{result1, result2}
}
func (fake *FakeAuthFallbackService) GetByIDReturnsOnCall(i int, result1 *admindb.User, result2 error) {
fake.getByIDMutex.Lock()
defer fake.getByIDMutex.Unlock()
fake.GetByIDStub = nil
if fake.getByIDReturnsOnCall == nil {
fake.getByIDReturnsOnCall = make(map[int]struct {
result1 *admindb.User
result2 error
})
}
fake.getByIDReturnsOnCall[i] = struct {
result1 *admindb.User
result2 error
}{result1, result2}
}
func (fake *FakeAuthFallbackService) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
@ -177,6 +259,8 @@ func (fake *FakeAuthFallbackService) Invocations() map[string][][]interface{} {
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

View File

@ -40,17 +40,17 @@ var Templates = func() http.FileSystem {
},
"/auth/fallback_sign_in.tmpl": &vfsgen۰CompressedFileInfo{
name: "fallback_sign_in.tmpl",
modTime: time.Date(2021, 2, 8, 10, 43, 54, 721000000, time.UTC),
uncompressedSize: 295,
modTime: time.Date(2021, 2, 9, 11, 30, 45, 990013778, time.UTC),
uncompressedSize: 419,
compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x5c\x8d\x41\x4e\xc3\x30\x10\x45\xf7\x3e\xc5\xc7\x7b\x2b\x2a\x6b\xc7\x4b\xb6\x20\xc1\x05\x5c\x7b\xd2\x8c\x70\xc6\x51\xe2\x36\x42\x96\xef\x8e\x1a\x88\x54\x58\xcd\x68\xde\xff\x6f\x6a\x45\xa4\x81\x85\xa0\x0b\x97\x44\x1a\xad\x0d\x3e\xa5\xb3\x0f\x9f\x58\xf9\x22\x86\xa5\x56\x90\x44\xb4\xa6\x1e\xd2\x21\x4b\x21\x29\xf7\xbc\xb2\x91\x6f\x08\xc9\xaf\x6b\xaf\x67\x7f\x21\x33\x92\x8f\xb4\x68\xa7\x00\x3b\x9e\xc0\xb1\xd7\x1b\xa5\x90\x27\xd2\xee\xe5\x9f\xdd\x76\xe3\xc9\x29\xdb\x45\xbe\xb9\x3f\xa6\x25\x6f\xbb\x01\x78\xbc\x86\x9c\xcc\x14\xcd\xe9\xf9\x60\x43\x5e\x26\xf8\x50\x38\x4b\xaf\xdf\x5e\xdf\x3f\x7e\xc1\x0e\x59\xe6\x6b\x41\xf9\x9a\xa9\xd7\xeb\xf5\x3c\x71\x39\x6a\xdd\xbd\x77\xec\x3f\xbf\xf7\x01\xfb\x64\x0c\xba\x25\x6f\x30\xc6\xa9\x5a\x49\x62\x6b\xdf\x01\x00\x00\xff\xff\xfe\x5d\xbf\xe3\x27\x01\x00\x00"),
compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x74\x8f\xcb\x6a\xeb\x30\x10\x86\xf7\x7e\x8a\x39\xb3\x17\xc6\x67\x19\x2c\x2f\xbb\x6d\xa1\x79\x01\x45\x1a\xc7\xa2\xba\x18\x69\x1c\xb7\x08\xbd\x7b\xb1\x53\x43\x5a\xda\x95\x2e\xf3\xf1\xcd\xff\x97\x02\x86\x46\x1b\x08\x90\x2d\x3b\x42\xa8\x75\x54\xce\x5d\x94\x7e\x83\x6c\xaf\x41\xd8\x50\x0a\x50\x30\x50\x6b\xf3\x40\xeb\x18\x98\x02\x6f\x7c\xd3\x1b\x7b\x03\xed\x54\xce\x12\x67\x75\x25\x31\x91\x32\x94\x70\x68\x00\xfa\xa9\x03\x6b\x24\xae\xe4\x74\xf4\x84\xc3\xd3\x0f\x7b\xdf\x4e\xdd\xd0\xf4\xad\xb1\xb7\xe1\x9b\x29\xc5\x75\x37\x00\x3c\xfe\xea\xe8\x84\x37\xa2\xfb\x7f\xcc\xc6\x98\x3c\x78\xe2\x29\x1a\x89\x2f\xcf\xaf\x67\x04\xa5\xd9\xc6\x20\x4b\x59\x92\x3b\x47\x40\xb5\xf0\x74\x3a\x5a\x9d\xb6\xbd\x36\x60\xad\x77\xc1\x2e\xb1\x61\x5e\x18\xf8\x63\x26\x89\x4c\xef\x8c\x10\x94\x27\x89\x4b\xfe\xaa\xf1\x0b\x37\xab\x9c\xd7\x98\xcc\xc1\x6e\xef\xbf\xd8\xbc\x5c\xbc\xe5\x23\x72\xbb\x65\x3e\xee\xf7\xde\xfb\x01\xfd\x3f\x21\xa0\x4d\x71\x05\x21\x86\xa6\x14\x0a\xa6\xd6\xcf\x00\x00\x00\xff\xff\x0f\xcb\x1b\x54\xa3\x01\x00\x00"),
},
"/base.tmpl": &vfsgen۰CompressedFileInfo{
name: "base.tmpl",
modTime: time.Date(2021, 2, 4, 13, 5, 58, 177632333, time.UTC),
uncompressedSize: 282,
modTime: time.Date(2021, 2, 9, 11, 35, 24, 675017182, time.UTC),
uncompressedSize: 715,
compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x54\x90\xbd\x4e\xc4\x30\x10\x84\xfb\x3c\xc5\x9c\x7b\x9f\x5b\x0a\x5f\x0a\x7e\x44\x09\x22\x34\x94\x1b\x7b\xd1\x45\xd8\xf1\xc9\x59\x22\x50\xe4\x77\x47\x76\x0e\x24\x2a\xcb\x9a\xfd\xe6\x5b\xad\x3d\xdc\x3f\xdd\xbd\xbe\x3d\x3f\xe0\x2c\x31\xf4\x9d\xfd\x7d\x98\x7c\xdf\x01\xf6\xa0\x35\x5c\x8a\x97\xc0\xc2\x18\x69\x61\x08\xc7\x4b\x20\x61\x68\xdd\x26\x22\x0b\xc1\x9d\x29\x2f\x2c\x27\xf5\x29\xef\xfa\x46\xc1\xb4\x48\x26\x09\xdc\x6f\xdb\x18\x92\xfb\x80\x6a\x5f\x85\x63\x29\x8f\x49\x0f\xc3\x2d\x5e\x52\x8a\x18\x38\xaf\x9c\xb7\x8d\x67\x5f\x8a\x35\x3b\xd3\x59\xb3\xaf\x60\xc7\xe4\xbf\x6b\xd9\x5f\x0b\x7f\x49\xa6\xd6\x72\x65\xaa\xc9\x4f\x2b\x5c\xa0\x65\x39\x29\x97\x66\xa1\x69\xe6\xac\x2a\x56\x41\x5c\xc9\x9a\xf0\x2c\x0a\x47\xfc\x83\x8d\x9f\xd6\x6a\xdc\x55\xd6\xb4\x1b\xfc\x04\x00\x00\xff\xff\xdb\xd4\x7e\xcf\x1a\x01\x00\x00"),
compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x94\x92\x31\x8f\x9c\x30\x10\x85\xfb\xfd\x15\xb3\x56\x5a\xd6\x6d\x84\x0c\x45\x72\x51\x52\x44\xb9\x28\x7b\x4d\xaa\xd3\x80\x07\xb0\x6e\xb0\x57\xb6\x59\xe5\x84\xfc\xdf\x23\xbc\xc0\x2a\x91\xa2\xe8\x2a\xf0\xcc\xbc\xef\x19\xde\xa8\xe3\xc3\xe3\xc7\xa7\x9f\xdf\x3f\xc1\x10\x47\xae\x0f\x6a\x7b\x10\xea\xfa\x00\xa0\x8e\x45\x01\xad\x1b\x2f\x4c\x91\xa0\xc1\x40\x10\x69\xbc\x30\x46\x82\xa2\xc8\x13\x23\x45\x84\x76\x40\x1f\x28\x56\x62\x8a\x5d\xf1\x5e\x80\xcc\xad\x68\x22\x53\x3d\xcf\x0d\xbb\xf6\x05\x44\x3e\x0a\x38\xa5\xf4\xd9\x15\xe7\xf3\x07\xf8\xe1\xdc\x08\x67\xf2\x57\xf2\xf3\x4c\x56\xa7\xa4\xe4\x4d\x73\x50\xf2\x76\x05\xd5\x38\xfd\xba\xc0\x76\x0a\xfd\x8a\x1e\x33\x65\xd5\x1c\x16\x2b\x6d\xae\x60\x74\x25\x82\x61\x7e\x2d\x2c\x5e\xc5\x22\x5a\x64\xef\xa6\x40\x1e\xca\x0a\x4c\x78\x66\xd7\xf7\xa4\x9f\x8d\x4d\x69\xed\x9a\x0e\xf2\xc0\x5a\x00\x50\x97\x7a\x7d\x03\xf8\x42\xcc\x6e\x43\x9c\xbe\xe1\x48\x29\x1d\xb7\x39\xb9\x0f\xaa\x89\xb3\xf7\xdd\x35\x57\xd9\xd4\x0a\x61\xf0\xd4\x55\x62\x9e\x27\xcf\x4f\x0e\x04\xea\xd1\xd8\x52\x63\x18\x1a\x87\x5e\x8b\x94\x44\xfd\xb0\x9d\x94\xc4\x5a\x49\x36\xff\x85\x4c\x71\x28\x3b\x64\x6e\xb0\x7d\x29\xd9\xf5\x6e\x8a\x99\xf4\xd5\xf5\x8f\x53\xfc\x1b\xa3\xe4\xc4\xdb\xdf\x20\x0e\x74\xff\xd6\xb7\x5c\xfc\x0f\xcf\x60\x7a\x6b\x6c\xd9\x39\x3f\x6e\xc6\x60\xec\x3f\x4d\x73\x4c\x4b\x4d\x9b\x6b\xbd\xe7\xd5\x32\x86\x50\x89\xd6\xd9\x88\xc6\x92\xdf\x23\x83\x35\xea\xa5\x43\x36\x0a\x38\xc1\x3d\xed\x1d\xa3\xe4\x6d\x37\x94\xcc\x4b\xfb\x3b\x00\x00\xff\xff\x98\x07\x68\xfe\xcb\x02\x00\x00"),
},
"/error.tmpl": &vfsgen۰CompressedFileInfo{
name: "error.tmpl",