Documentation ¶
Index ¶
- type EntityRepository
- func (_m *EntityRepository[T]) Count(ctx context.Context) (int64, error)
- func (_m *EntityRepository[T]) Create(ctx context.Context, entity *T) (*T, error)
- func (_m *EntityRepository[T]) DeleteByID(ctx context.Context, id uint) error
- func (_m *EntityRepository[T]) EXPECT() *EntityRepository_Expecter[T]
- func (_m *EntityRepository[T]) FindAll(ctx context.Context, pagination *models.Pagination) (*models.Page[*T], error)
- func (_m *EntityRepository[T]) FindAllByCriteria(ctx context.Context, criteriaAndPagination interface{}, ...) (*models.Page[*T], error)
- func (_m *EntityRepository[T]) FindOneByID(ctx context.Context, id uint) (*T, error)
- func (_m *EntityRepository[T]) FindOneByIDForUpdate(ctx context.Context, id uint) (*T, error)
- func (_m *EntityRepository[T]) Gorm() *gorm.DB
- func (_m *EntityRepository[T]) Save(ctx context.Context, entity *T) (*T, error)
- func (_m *EntityRepository[T]) TransactWithDefaultRetry(operation func(*gorm.DB) error) error
- func (_m *EntityRepository[T]) WithTx(tx *gorm.DB) persistence.EntityRepository[T]
- func (_m *EntityRepository[T]) WrapError(err error) error
- type EntityRepository_Count_Call
- type EntityRepository_Create_Call
- type EntityRepository_DeleteByID_Call
- type EntityRepository_Expecter
- func (_e *EntityRepository_Expecter[T]) Count(ctx interface{}) *EntityRepository_Count_Call[T]
- func (_e *EntityRepository_Expecter[T]) Create(ctx interface{}, entity interface{}) *EntityRepository_Create_Call[T]
- func (_e *EntityRepository_Expecter[T]) DeleteByID(ctx interface{}, id interface{}) *EntityRepository_DeleteByID_Call[T]
- func (_e *EntityRepository_Expecter[T]) FindAll(ctx interface{}, pagination interface{}) *EntityRepository_FindAll_Call[T]
- func (_e *EntityRepository_Expecter[T]) FindAllByCriteria(ctx interface{}, criteriaAndPagination interface{}, pagination interface{}) *EntityRepository_FindAllByCriteria_Call[T]
- func (_e *EntityRepository_Expecter[T]) FindOneByID(ctx interface{}, id interface{}) *EntityRepository_FindOneByID_Call[T]
- func (_e *EntityRepository_Expecter[T]) FindOneByIDForUpdate(ctx interface{}, id interface{}) *EntityRepository_FindOneByIDForUpdate_Call[T]
- func (_e *EntityRepository_Expecter[T]) Gorm() *EntityRepository_Gorm_Call[T]
- func (_e *EntityRepository_Expecter[T]) Save(ctx interface{}, entity interface{}) *EntityRepository_Save_Call[T]
- func (_e *EntityRepository_Expecter[T]) TransactWithDefaultRetry(operation interface{}) *EntityRepository_TransactWithDefaultRetry_Call[T]
- func (_e *EntityRepository_Expecter[T]) WithTx(tx interface{}) *EntityRepository_WithTx_Call[T]
- func (_e *EntityRepository_Expecter[T]) WrapError(err interface{}) *EntityRepository_WrapError_Call[T]
- type EntityRepository_FindAllByCriteria_Call
- func (_c *EntityRepository_FindAllByCriteria_Call[T]) Return(page *models.Page[*T], err error) *EntityRepository_FindAllByCriteria_Call[T]
- func (_c *EntityRepository_FindAllByCriteria_Call[T]) Run(run func(ctx context.Context, criteriaAndPagination interface{}, ...)) *EntityRepository_FindAllByCriteria_Call[T]
- type EntityRepository_FindAll_Call
- type EntityRepository_FindOneByIDForUpdate_Call
- type EntityRepository_FindOneByID_Call
- type EntityRepository_Gorm_Call
- type EntityRepository_Save_Call
- type EntityRepository_TransactWithDefaultRetry_Call
- type EntityRepository_WithTx_Call
- type EntityRepository_WrapError_Call
- type Repository
- type Repository_Expecter
- func (_e *Repository_Expecter) Gorm() *Repository_Gorm_Call
- func (_e *Repository_Expecter) RawSQL(ctx interface{}, sql interface{}, values ...interface{}) *Repository_RawSQL_Call
- func (_e *Repository_Expecter) WithTx(tx interface{}) *Repository_WithTx_Call
- func (_e *Repository_Expecter) WrapError(err interface{}) *Repository_WrapError_Call
- type Repository_Gorm_Call
- type Repository_RawSQL_Call
- type Repository_WithTx_Call
- type Repository_WrapError_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityRepository ¶
type EntityRepository[T common.EntityConstraint] struct { mock.Mock }
EntityRepository is an autogenerated mock type for the EntityRepository type
func NewEntityRepository ¶
func NewEntityRepository[T common.EntityConstraint](t mockConstructorTestingTNewEntityRepository) *EntityRepository[T]
NewEntityRepository creates a new instance of EntityRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*EntityRepository[T]) Count ¶
func (_m *EntityRepository[T]) Count(ctx context.Context) (int64, error)
Count provides a mock function with given fields: ctx
func (*EntityRepository[T]) Create ¶
func (_m *EntityRepository[T]) Create(ctx context.Context, entity *T) (*T, error)
Create provides a mock function with given fields: ctx, entity
func (*EntityRepository[T]) DeleteByID ¶
func (_m *EntityRepository[T]) DeleteByID(ctx context.Context, id uint) error
DeleteByID provides a mock function with given fields: ctx, id
func (*EntityRepository[T]) EXPECT ¶
func (_m *EntityRepository[T]) EXPECT() *EntityRepository_Expecter[T]
func (*EntityRepository[T]) FindAll ¶
func (_m *EntityRepository[T]) FindAll(ctx context.Context, pagination *models.Pagination) (*models.Page[*T], error)
FindAll provides a mock function with given fields: ctx, pagination
func (*EntityRepository[T]) FindAllByCriteria ¶
func (_m *EntityRepository[T]) FindAllByCriteria(ctx context.Context, criteriaAndPagination interface{}, pagination *models.Pagination) (*models.Page[*T], error)
FindAllByCriteria provides a mock function with given fields: ctx, criteriaAndPagination, pagination
func (*EntityRepository[T]) FindOneByID ¶
func (_m *EntityRepository[T]) FindOneByID(ctx context.Context, id uint) (*T, error)
FindOneByID provides a mock function with given fields: ctx, id
func (*EntityRepository[T]) FindOneByIDForUpdate ¶
func (_m *EntityRepository[T]) FindOneByIDForUpdate(ctx context.Context, id uint) (*T, error)
FindOneByIDForUpdate provides a mock function with given fields: ctx, id
func (*EntityRepository[T]) Gorm ¶
func (_m *EntityRepository[T]) Gorm() *gorm.DB
Gorm provides a mock function with given fields:
func (*EntityRepository[T]) Save ¶
func (_m *EntityRepository[T]) Save(ctx context.Context, entity *T) (*T, error)
Save provides a mock function with given fields: ctx, entity
func (*EntityRepository[T]) TransactWithDefaultRetry ¶
func (_m *EntityRepository[T]) TransactWithDefaultRetry(operation func(*gorm.DB) error) error
TransactWithDefaultRetry provides a mock function with given fields: operation
func (*EntityRepository[T]) WithTx ¶
func (_m *EntityRepository[T]) WithTx(tx *gorm.DB) persistence.EntityRepository[T]
WithTx provides a mock function with given fields: tx
func (*EntityRepository[T]) WrapError ¶
func (_m *EntityRepository[T]) WrapError(err error) error
WrapError provides a mock function with given fields: err
type EntityRepository_Count_Call ¶
type EntityRepository_Count_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count'
func (*EntityRepository_Count_Call[T]) Return ¶
func (_c *EntityRepository_Count_Call[T]) Return(_a0 int64, _a1 error) *EntityRepository_Count_Call[T]
func (*EntityRepository_Count_Call[T]) Run ¶
func (_c *EntityRepository_Count_Call[T]) Run(run func(ctx context.Context)) *EntityRepository_Count_Call[T]
type EntityRepository_Create_Call ¶
type EntityRepository_Create_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*EntityRepository_Create_Call[T]) Return ¶
func (_c *EntityRepository_Create_Call[T]) Return(_a0 *T, _a1 error) *EntityRepository_Create_Call[T]
func (*EntityRepository_Create_Call[T]) Run ¶
func (_c *EntityRepository_Create_Call[T]) Run(run func(ctx context.Context, entity *T)) *EntityRepository_Create_Call[T]
type EntityRepository_DeleteByID_Call ¶
type EntityRepository_DeleteByID_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_DeleteByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByID'
func (*EntityRepository_DeleteByID_Call[T]) Return ¶
func (_c *EntityRepository_DeleteByID_Call[T]) Return(_a0 error) *EntityRepository_DeleteByID_Call[T]
func (*EntityRepository_DeleteByID_Call[T]) Run ¶
func (_c *EntityRepository_DeleteByID_Call[T]) Run(run func(ctx context.Context, id uint)) *EntityRepository_DeleteByID_Call[T]
type EntityRepository_Expecter ¶
type EntityRepository_Expecter[T common.EntityConstraint] struct { // contains filtered or unexported fields }
func (*EntityRepository_Expecter[T]) Count ¶
func (_e *EntityRepository_Expecter[T]) Count(ctx interface{}) *EntityRepository_Count_Call[T]
Count is a helper method to define mock.On call
- ctx context.Context
func (*EntityRepository_Expecter[T]) Create ¶
func (_e *EntityRepository_Expecter[T]) Create(ctx interface{}, entity interface{}) *EntityRepository_Create_Call[T]
Create is a helper method to define mock.On call
- ctx context.Context
- entity *T
func (*EntityRepository_Expecter[T]) DeleteByID ¶
func (_e *EntityRepository_Expecter[T]) DeleteByID(ctx interface{}, id interface{}) *EntityRepository_DeleteByID_Call[T]
DeleteByID is a helper method to define mock.On call
- ctx context.Context
- id uint
func (*EntityRepository_Expecter[T]) FindAll ¶
func (_e *EntityRepository_Expecter[T]) FindAll(ctx interface{}, pagination interface{}) *EntityRepository_FindAll_Call[T]
FindAll is a helper method to define mock.On call
- ctx context.Context
- pagination *models.Pagination
func (*EntityRepository_Expecter[T]) FindAllByCriteria ¶
func (_e *EntityRepository_Expecter[T]) FindAllByCriteria(ctx interface{}, criteriaAndPagination interface{}, pagination interface{}) *EntityRepository_FindAllByCriteria_Call[T]
FindAllByCriteria is a helper method to define mock.On call
- ctx context.Context
- criteriaAndPagination interface{}
- pagination *models.Pagination
func (*EntityRepository_Expecter[T]) FindOneByID ¶
func (_e *EntityRepository_Expecter[T]) FindOneByID(ctx interface{}, id interface{}) *EntityRepository_FindOneByID_Call[T]
FindOneByID is a helper method to define mock.On call
- ctx context.Context
- id uint
func (*EntityRepository_Expecter[T]) FindOneByIDForUpdate ¶
func (_e *EntityRepository_Expecter[T]) FindOneByIDForUpdate(ctx interface{}, id interface{}) *EntityRepository_FindOneByIDForUpdate_Call[T]
FindOneByIDForUpdate is a helper method to define mock.On call
- ctx context.Context
- id uint
func (*EntityRepository_Expecter[T]) Gorm ¶
func (_e *EntityRepository_Expecter[T]) Gorm() *EntityRepository_Gorm_Call[T]
Gorm is a helper method to define mock.On call
func (*EntityRepository_Expecter[T]) Save ¶
func (_e *EntityRepository_Expecter[T]) Save(ctx interface{}, entity interface{}) *EntityRepository_Save_Call[T]
Save is a helper method to define mock.On call
- ctx context.Context
- entity *T
func (*EntityRepository_Expecter[T]) TransactWithDefaultRetry ¶
func (_e *EntityRepository_Expecter[T]) TransactWithDefaultRetry(operation interface{}) *EntityRepository_TransactWithDefaultRetry_Call[T]
TransactWithDefaultRetry is a helper method to define mock.On call
- operation func(*gorm.DB) error
func (*EntityRepository_Expecter[T]) WithTx ¶
func (_e *EntityRepository_Expecter[T]) WithTx(tx interface{}) *EntityRepository_WithTx_Call[T]
WithTx is a helper method to define mock.On call
- tx *gorm.DB
func (*EntityRepository_Expecter[T]) WrapError ¶
func (_e *EntityRepository_Expecter[T]) WrapError(err interface{}) *EntityRepository_WrapError_Call[T]
WrapError is a helper method to define mock.On call
- err error
type EntityRepository_FindAllByCriteria_Call ¶
type EntityRepository_FindAllByCriteria_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_FindAllByCriteria_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindAllByCriteria'
func (*EntityRepository_FindAllByCriteria_Call[T]) Return ¶
func (_c *EntityRepository_FindAllByCriteria_Call[T]) Return(page *models.Page[*T], err error) *EntityRepository_FindAllByCriteria_Call[T]
func (*EntityRepository_FindAllByCriteria_Call[T]) Run ¶
func (_c *EntityRepository_FindAllByCriteria_Call[T]) Run(run func(ctx context.Context, criteriaAndPagination interface{}, pagination *models.Pagination)) *EntityRepository_FindAllByCriteria_Call[T]
type EntityRepository_FindAll_Call ¶
type EntityRepository_FindAll_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_FindAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindAll'
func (*EntityRepository_FindAll_Call[T]) Return ¶
func (_c *EntityRepository_FindAll_Call[T]) Return(page *models.Page[*T], err error) *EntityRepository_FindAll_Call[T]
func (*EntityRepository_FindAll_Call[T]) Run ¶
func (_c *EntityRepository_FindAll_Call[T]) Run(run func(ctx context.Context, pagination *models.Pagination)) *EntityRepository_FindAll_Call[T]
type EntityRepository_FindOneByIDForUpdate_Call ¶
type EntityRepository_FindOneByIDForUpdate_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_FindOneByIDForUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOneByIDForUpdate'
func (*EntityRepository_FindOneByIDForUpdate_Call[T]) Return ¶
func (_c *EntityRepository_FindOneByIDForUpdate_Call[T]) Return(entity *T, err error) *EntityRepository_FindOneByIDForUpdate_Call[T]
func (*EntityRepository_FindOneByIDForUpdate_Call[T]) Run ¶
func (_c *EntityRepository_FindOneByIDForUpdate_Call[T]) Run(run func(ctx context.Context, id uint)) *EntityRepository_FindOneByIDForUpdate_Call[T]
type EntityRepository_FindOneByID_Call ¶
type EntityRepository_FindOneByID_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_FindOneByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOneByID'
func (*EntityRepository_FindOneByID_Call[T]) Return ¶
func (_c *EntityRepository_FindOneByID_Call[T]) Return(entity *T, err error) *EntityRepository_FindOneByID_Call[T]
func (*EntityRepository_FindOneByID_Call[T]) Run ¶
func (_c *EntityRepository_FindOneByID_Call[T]) Run(run func(ctx context.Context, id uint)) *EntityRepository_FindOneByID_Call[T]
type EntityRepository_Gorm_Call ¶
type EntityRepository_Gorm_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_Gorm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Gorm'
func (*EntityRepository_Gorm_Call[T]) Return ¶
func (_c *EntityRepository_Gorm_Call[T]) Return(_a0 *gorm.DB) *EntityRepository_Gorm_Call[T]
func (*EntityRepository_Gorm_Call[T]) Run ¶
func (_c *EntityRepository_Gorm_Call[T]) Run(run func()) *EntityRepository_Gorm_Call[T]
type EntityRepository_Save_Call ¶
type EntityRepository_Save_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
func (*EntityRepository_Save_Call[T]) Return ¶
func (_c *EntityRepository_Save_Call[T]) Return(_a0 *T, _a1 error) *EntityRepository_Save_Call[T]
func (*EntityRepository_Save_Call[T]) Run ¶
func (_c *EntityRepository_Save_Call[T]) Run(run func(ctx context.Context, entity *T)) *EntityRepository_Save_Call[T]
type EntityRepository_TransactWithDefaultRetry_Call ¶
type EntityRepository_TransactWithDefaultRetry_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_TransactWithDefaultRetry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactWithDefaultRetry'
func (*EntityRepository_TransactWithDefaultRetry_Call[T]) Return ¶
func (_c *EntityRepository_TransactWithDefaultRetry_Call[T]) Return(_a0 error) *EntityRepository_TransactWithDefaultRetry_Call[T]
func (*EntityRepository_TransactWithDefaultRetry_Call[T]) Run ¶
func (_c *EntityRepository_TransactWithDefaultRetry_Call[T]) Run(run func(operation func(*gorm.DB) error)) *EntityRepository_TransactWithDefaultRetry_Call[T]
type EntityRepository_WithTx_Call ¶
type EntityRepository_WithTx_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_WithTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithTx'
func (*EntityRepository_WithTx_Call[T]) Return ¶
func (_c *EntityRepository_WithTx_Call[T]) Return(_a0 persistence.EntityRepository[T]) *EntityRepository_WithTx_Call[T]
func (*EntityRepository_WithTx_Call[T]) Run ¶
func (_c *EntityRepository_WithTx_Call[T]) Run(run func(tx *gorm.DB)) *EntityRepository_WithTx_Call[T]
type EntityRepository_WrapError_Call ¶
type EntityRepository_WrapError_Call[T common.EntityConstraint] struct { *mock.Call }
EntityRepository_WrapError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WrapError'
func (*EntityRepository_WrapError_Call[T]) Return ¶
func (_c *EntityRepository_WrapError_Call[T]) Return(_a0 error) *EntityRepository_WrapError_Call[T]
func (*EntityRepository_WrapError_Call[T]) Run ¶
func (_c *EntityRepository_WrapError_Call[T]) Run(run func(err error)) *EntityRepository_WrapError_Call[T]
type Repository ¶
Repository is an autogenerated mock type for the Repository type
func NewRepository ¶
func NewRepository(t mockConstructorTestingTNewRepository) *Repository
NewRepository creates a new instance of Repository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*Repository) EXPECT ¶
func (_m *Repository) EXPECT() *Repository_Expecter
func (*Repository) Gorm ¶
func (_m *Repository) Gorm() *gorm.DB
Gorm provides a mock function with given fields:
func (*Repository) RawSQL ¶
func (_m *Repository) RawSQL(ctx context.Context, sql string, values ...interface{}) error
RawSQL provides a mock function with given fields: ctx, sql, values
func (*Repository) WithTx ¶
func (_m *Repository) WithTx(tx *gorm.DB) persistence.Repository
WithTx provides a mock function with given fields: tx
func (*Repository) WrapError ¶
func (_m *Repository) WrapError(err error) error
WrapError provides a mock function with given fields: err
type Repository_Expecter ¶
type Repository_Expecter struct {
// contains filtered or unexported fields
}
func (*Repository_Expecter) Gorm ¶
func (_e *Repository_Expecter) Gorm() *Repository_Gorm_Call
Gorm is a helper method to define mock.On call
func (*Repository_Expecter) RawSQL ¶
func (_e *Repository_Expecter) RawSQL(ctx interface{}, sql interface{}, values ...interface{}) *Repository_RawSQL_Call
RawSQL is a helper method to define mock.On call
- ctx context.Context
- sql string
- values ...interface{}
func (*Repository_Expecter) WithTx ¶
func (_e *Repository_Expecter) WithTx(tx interface{}) *Repository_WithTx_Call
WithTx is a helper method to define mock.On call
- tx *gorm.DB
func (*Repository_Expecter) WrapError ¶
func (_e *Repository_Expecter) WrapError(err interface{}) *Repository_WrapError_Call
WrapError is a helper method to define mock.On call
- err error
type Repository_Gorm_Call ¶
Repository_Gorm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Gorm'
func (*Repository_Gorm_Call) Return ¶
func (_c *Repository_Gorm_Call) Return(_a0 *gorm.DB) *Repository_Gorm_Call
func (*Repository_Gorm_Call) Run ¶
func (_c *Repository_Gorm_Call) Run(run func()) *Repository_Gorm_Call
type Repository_RawSQL_Call ¶
Repository_RawSQL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawSQL'
func (*Repository_RawSQL_Call) Return ¶
func (_c *Repository_RawSQL_Call) Return(_a0 error) *Repository_RawSQL_Call
func (*Repository_RawSQL_Call) Run ¶
func (_c *Repository_RawSQL_Call) Run(run func(ctx context.Context, sql string, values ...interface{})) *Repository_RawSQL_Call
type Repository_WithTx_Call ¶
Repository_WithTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithTx'
func (*Repository_WithTx_Call) Return ¶
func (_c *Repository_WithTx_Call) Return(_a0 persistence.Repository) *Repository_WithTx_Call
func (*Repository_WithTx_Call) Run ¶
func (_c *Repository_WithTx_Call) Run(run func(tx *gorm.DB)) *Repository_WithTx_Call
type Repository_WrapError_Call ¶
Repository_WrapError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WrapError'
func (*Repository_WrapError_Call) Return ¶
func (_c *Repository_WrapError_Call) Return(_a0 error) *Repository_WrapError_Call
func (*Repository_WrapError_Call) Run ¶
func (_c *Repository_WrapError_Call) Run(run func(err error)) *Repository_WrapError_Call