Swap direct access to the DB on the API server with an data abstraction layer. Implement each API type converter separately and revert changes to the auto-generated server implementation types. Add error return to DAL methods. Implement `Transactions`. Add tools.go with oapi-codegen and mockgen. https://www.jvt.me/posts/2022/06/15/go-tools-dependency-management/ Update go packages. Issues #5, #12
101 lines
2.8 KiB
Go
101 lines
2.8 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: git.rosemyrtle.work/personal-finance/server/internal/dal (interfaces: DAL)
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -destination=../mock/mock_dal.gen.go -package=mock . DAL
|
|
//
|
|
|
|
// Package mock is a generated GoMock package.
|
|
package mock
|
|
|
|
import (
|
|
reflect "reflect"
|
|
|
|
entity "git.rosemyrtle.work/personal-finance/server/internal/entity"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockDAL is a mock of DAL interface.
|
|
type MockDAL struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockDALMockRecorder
|
|
}
|
|
|
|
// MockDALMockRecorder is the mock recorder for MockDAL.
|
|
type MockDALMockRecorder struct {
|
|
mock *MockDAL
|
|
}
|
|
|
|
// NewMockDAL creates a new mock instance.
|
|
func NewMockDAL(ctrl *gomock.Controller) *MockDAL {
|
|
mock := &MockDAL{ctrl: ctrl}
|
|
mock.recorder = &MockDALMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockDAL) EXPECT() *MockDALMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Bank mocks base method.
|
|
func (m *MockDAL) Bank() (entity.Bank, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Bank")
|
|
ret0, _ := ret[0].(entity.Bank)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Bank indicates an expected call of Bank.
|
|
func (mr *MockDALMockRecorder) Bank() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Bank", reflect.TypeOf((*MockDAL)(nil).Bank))
|
|
}
|
|
|
|
// Banks mocks base method.
|
|
func (m *MockDAL) Banks() ([]entity.Bank, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Banks")
|
|
ret0, _ := ret[0].([]entity.Bank)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Banks indicates an expected call of Banks.
|
|
func (mr *MockDALMockRecorder) Banks() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Banks", reflect.TypeOf((*MockDAL)(nil).Banks))
|
|
}
|
|
|
|
// Transaction mocks base method.
|
|
func (m *MockDAL) Transaction() (entity.Transaction, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Transaction")
|
|
ret0, _ := ret[0].(entity.Transaction)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Transaction indicates an expected call of Transaction.
|
|
func (mr *MockDALMockRecorder) Transaction() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transaction", reflect.TypeOf((*MockDAL)(nil).Transaction))
|
|
}
|
|
|
|
// Transactions mocks base method.
|
|
func (m *MockDAL) Transactions() ([]entity.Transaction, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Transactions")
|
|
ret0, _ := ret[0].([]entity.Transaction)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Transactions indicates an expected call of Transactions.
|
|
func (mr *MockDALMockRecorder) Transactions() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transactions", reflect.TypeOf((*MockDAL)(nil).Transactions))
|
|
}
|