Documentation
¶
Overview ¶
Package models is a generated GoMock package.
Package models is a generated GoMock package.
Index ¶
- type Category
- type CategoryRepository
- type GetManyCategoryPayload
- type GetManyProductPayload
- type MockCategoryRepository
- func (m *MockCategoryRepository) Client() sqlutils.SQLDB
- func (m *MockCategoryRepository) CreateCategory(ctx context.Context, category *Category) (int64, error)
- func (m *MockCategoryRepository) DeleteAllCategoriesInCache(ctx context.Context) error
- func (m *MockCategoryRepository) DeleteCategory(ctx context.Context, id uuid.UUID) (int64, error)
- func (m *MockCategoryRepository) DeleteCategoryInCache(ctx context.Context, categoryID uuid.UUID) error
- func (m *MockCategoryRepository) EXPECT() *MockCategoryRepositoryMockRecorder
- func (m *MockCategoryRepository) GetCategoryByID(ctx context.Context, id uuid.UUID) (*Category, error)
- func (m *MockCategoryRepository) GetCategoryInCache(ctx context.Context, categoryID uuid.UUID) *Category
- func (m *MockCategoryRepository) GetManyCategory(ctx context.Context, data GetManyCategoryPayload) ([]*Category, error)
- func (m *MockCategoryRepository) SetCategoryInCache(ctx context.Context, category *Category, expiration time.Duration) error
- func (m *MockCategoryRepository) UpdateCategory(ctx context.Context, id uuid.UUID, category *Category) (int64, error)
- func (m *MockCategoryRepository) WithTx(tx sqlutils.SQLTX) CategoryRepository
- type MockCategoryRepositoryMockRecorder
- func (mr *MockCategoryRepositoryMockRecorder) Client() *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) CreateCategory(ctx, category any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) DeleteAllCategoriesInCache(ctx any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) DeleteCategory(ctx, id any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) DeleteCategoryInCache(ctx, categoryID any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) GetCategoryByID(ctx, id any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) GetCategoryInCache(ctx, categoryID any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) GetManyCategory(ctx, data any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) SetCategoryInCache(ctx, category, expiration any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) UpdateCategory(ctx, id, category any) *gomock.Call
- func (mr *MockCategoryRepositoryMockRecorder) WithTx(tx any) *gomock.Call
- type MockProductRepository
- func (m *MockProductRepository) Client() sqlutils.SQLDB
- func (m *MockProductRepository) CreateProduct(ctx context.Context, data *Product) (int64, error)
- func (m *MockProductRepository) DeleteProduct(ctx context.Context, id uuid.UUID) (int64, error)
- func (m *MockProductRepository) EXPECT() *MockProductRepositoryMockRecorder
- func (m *MockProductRepository) GetManyProduct(ctx context.Context, data GetManyProductPayload) ([]*Product, error)
- func (m *MockProductRepository) GetManyProductByCategoryID(ctx context.Context, categoryID uuid.UUID) ([]*Product, error)
- func (m *MockProductRepository) GetProductByID(ctx context.Context, id uuid.UUID) (*Product, error)
- func (m *MockProductRepository) UpdateProduct(ctx context.Context, id uuid.UUID, data *Product) (int64, error)
- func (m *MockProductRepository) WithTx(tx sqlutils.SQLTX) ProductRepository
- type MockProductRepositoryMockRecorder
- func (mr *MockProductRepositoryMockRecorder) Client() *gomock.Call
- func (mr *MockProductRepositoryMockRecorder) CreateProduct(ctx, data any) *gomock.Call
- func (mr *MockProductRepositoryMockRecorder) DeleteProduct(ctx, id any) *gomock.Call
- func (mr *MockProductRepositoryMockRecorder) GetManyProduct(ctx, data any) *gomock.Call
- func (mr *MockProductRepositoryMockRecorder) GetManyProductByCategoryID(ctx, categoryID any) *gomock.Call
- func (mr *MockProductRepositoryMockRecorder) GetProductByID(ctx, id any) *gomock.Call
- func (mr *MockProductRepositoryMockRecorder) UpdateProduct(ctx, id, data any) *gomock.Call
- func (mr *MockProductRepositoryMockRecorder) WithTx(tx any) *gomock.Call
- type Product
- type ProductRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description *string `json:"description"`
Products []*Product `json:"products,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt *int64 `json:"updated_at"`
}
func NewCategory ¶
func (*Category) MarshalBinary ¶
func (*Category) UnmarshalBinary ¶
type CategoryRepository ¶
type CategoryRepository interface {
CreateCategory(ctx context.Context, category *Category) (int64, error)
UpdateCategory(ctx context.Context, id uuid.UUID, category *Category) (int64, error)
DeleteCategory(ctx context.Context, id uuid.UUID) (int64, error)
GetCategoryByID(ctx context.Context, id uuid.UUID) (*Category, error)
GetManyCategory(ctx context.Context, data GetManyCategoryPayload) ([]*Category, error)
DeleteAllCategoriesInCache(ctx context.Context) error
DeleteCategoryInCache(ctx context.Context, categoryID uuid.UUID) error
GetCategoryInCache(ctx context.Context, categoryID uuid.UUID) *Category
SetCategoryInCache(ctx context.Context, category *Category, expiration time.Duration) error
WithTx(tx sqlutils.SQLTX) CategoryRepository
Client() sqlutils.SQLDB
}
TODO
type GetManyCategoryPayload ¶
type GetManyCategoryPayload struct {
Page string
PerPage string
OrderBy string
OrderDirection string
}
TODO
type GetManyProductPayload ¶
type GetManyProductPayload struct {
Page string
PerPage string
OrderBy string
OrderDirection string
}
TODO
type MockCategoryRepository ¶
type MockCategoryRepository struct {
// contains filtered or unexported fields
}
MockCategoryRepository is a mock of CategoryRepository interface.
func NewMockCategoryRepository ¶
func NewMockCategoryRepository(ctrl *gomock.Controller) *MockCategoryRepository
NewMockCategoryRepository creates a new mock instance.
func (*MockCategoryRepository) Client ¶
func (m *MockCategoryRepository) Client() sqlutils.SQLDB
Client mocks base method.
func (*MockCategoryRepository) CreateCategory ¶
func (m *MockCategoryRepository) CreateCategory(ctx context.Context, category *Category) (int64, error)
CreateCategory mocks base method.
func (*MockCategoryRepository) DeleteAllCategoriesInCache ¶
func (m *MockCategoryRepository) DeleteAllCategoriesInCache(ctx context.Context) error
DeleteAllCategoriesInCache mocks base method.
func (*MockCategoryRepository) DeleteCategory ¶
DeleteCategory mocks base method.
func (*MockCategoryRepository) DeleteCategoryInCache ¶
func (m *MockCategoryRepository) DeleteCategoryInCache(ctx context.Context, categoryID uuid.UUID) error
DeleteCategoryInCache mocks base method.
func (*MockCategoryRepository) EXPECT ¶
func (m *MockCategoryRepository) EXPECT() *MockCategoryRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCategoryRepository) GetCategoryByID ¶
func (m *MockCategoryRepository) GetCategoryByID(ctx context.Context, id uuid.UUID) (*Category, error)
GetCategoryByID mocks base method.
func (*MockCategoryRepository) GetCategoryInCache ¶
func (m *MockCategoryRepository) GetCategoryInCache(ctx context.Context, categoryID uuid.UUID) *Category
GetCategoryInCache mocks base method.
func (*MockCategoryRepository) GetManyCategory ¶
func (m *MockCategoryRepository) GetManyCategory(ctx context.Context, data GetManyCategoryPayload) ([]*Category, error)
GetManyCategory mocks base method.
func (*MockCategoryRepository) SetCategoryInCache ¶
func (m *MockCategoryRepository) SetCategoryInCache(ctx context.Context, category *Category, expiration time.Duration) error
SetCategoryInCache mocks base method.
func (*MockCategoryRepository) UpdateCategory ¶
func (m *MockCategoryRepository) UpdateCategory(ctx context.Context, id uuid.UUID, category *Category) (int64, error)
UpdateCategory mocks base method.
func (*MockCategoryRepository) WithTx ¶
func (m *MockCategoryRepository) WithTx(tx sqlutils.SQLTX) CategoryRepository
WithTx mocks base method.
type MockCategoryRepositoryMockRecorder ¶
type MockCategoryRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockCategoryRepositoryMockRecorder is the mock recorder for MockCategoryRepository.
func (*MockCategoryRepositoryMockRecorder) Client ¶
func (mr *MockCategoryRepositoryMockRecorder) Client() *gomock.Call
Client indicates an expected call of Client.
func (*MockCategoryRepositoryMockRecorder) CreateCategory ¶
func (mr *MockCategoryRepositoryMockRecorder) CreateCategory(ctx, category any) *gomock.Call
CreateCategory indicates an expected call of CreateCategory.
func (*MockCategoryRepositoryMockRecorder) DeleteAllCategoriesInCache ¶
func (mr *MockCategoryRepositoryMockRecorder) DeleteAllCategoriesInCache(ctx any) *gomock.Call
DeleteAllCategoriesInCache indicates an expected call of DeleteAllCategoriesInCache.
func (*MockCategoryRepositoryMockRecorder) DeleteCategory ¶
func (mr *MockCategoryRepositoryMockRecorder) DeleteCategory(ctx, id any) *gomock.Call
DeleteCategory indicates an expected call of DeleteCategory.
func (*MockCategoryRepositoryMockRecorder) DeleteCategoryInCache ¶
func (mr *MockCategoryRepositoryMockRecorder) DeleteCategoryInCache(ctx, categoryID any) *gomock.Call
DeleteCategoryInCache indicates an expected call of DeleteCategoryInCache.
func (*MockCategoryRepositoryMockRecorder) GetCategoryByID ¶
func (mr *MockCategoryRepositoryMockRecorder) GetCategoryByID(ctx, id any) *gomock.Call
GetCategoryByID indicates an expected call of GetCategoryByID.
func (*MockCategoryRepositoryMockRecorder) GetCategoryInCache ¶
func (mr *MockCategoryRepositoryMockRecorder) GetCategoryInCache(ctx, categoryID any) *gomock.Call
GetCategoryInCache indicates an expected call of GetCategoryInCache.
func (*MockCategoryRepositoryMockRecorder) GetManyCategory ¶
func (mr *MockCategoryRepositoryMockRecorder) GetManyCategory(ctx, data any) *gomock.Call
GetManyCategory indicates an expected call of GetManyCategory.
func (*MockCategoryRepositoryMockRecorder) SetCategoryInCache ¶
func (mr *MockCategoryRepositoryMockRecorder) SetCategoryInCache(ctx, category, expiration any) *gomock.Call
SetCategoryInCache indicates an expected call of SetCategoryInCache.
func (*MockCategoryRepositoryMockRecorder) UpdateCategory ¶
func (mr *MockCategoryRepositoryMockRecorder) UpdateCategory(ctx, id, category any) *gomock.Call
UpdateCategory indicates an expected call of UpdateCategory.
type MockProductRepository ¶
type MockProductRepository struct {
// contains filtered or unexported fields
}
MockProductRepository is a mock of ProductRepository interface.
func NewMockProductRepository ¶
func NewMockProductRepository(ctrl *gomock.Controller) *MockProductRepository
NewMockProductRepository creates a new mock instance.
func (*MockProductRepository) Client ¶
func (m *MockProductRepository) Client() sqlutils.SQLDB
Client mocks base method.
func (*MockProductRepository) CreateProduct ¶
CreateProduct mocks base method.
func (*MockProductRepository) DeleteProduct ¶
DeleteProduct mocks base method.
func (*MockProductRepository) EXPECT ¶
func (m *MockProductRepository) EXPECT() *MockProductRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockProductRepository) GetManyProduct ¶
func (m *MockProductRepository) GetManyProduct(ctx context.Context, data GetManyProductPayload) ([]*Product, error)
GetManyProduct mocks base method.
func (*MockProductRepository) GetManyProductByCategoryID ¶
func (m *MockProductRepository) GetManyProductByCategoryID(ctx context.Context, categoryID uuid.UUID) ([]*Product, error)
GetManyProductByCategoryID mocks base method.
func (*MockProductRepository) GetProductByID ¶
GetProductByID mocks base method.
func (*MockProductRepository) UpdateProduct ¶
func (m *MockProductRepository) UpdateProduct(ctx context.Context, id uuid.UUID, data *Product) (int64, error)
UpdateProduct mocks base method.
func (*MockProductRepository) WithTx ¶
func (m *MockProductRepository) WithTx(tx sqlutils.SQLTX) ProductRepository
WithTx mocks base method.
type MockProductRepositoryMockRecorder ¶
type MockProductRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockProductRepositoryMockRecorder is the mock recorder for MockProductRepository.
func (*MockProductRepositoryMockRecorder) Client ¶
func (mr *MockProductRepositoryMockRecorder) Client() *gomock.Call
Client indicates an expected call of Client.
func (*MockProductRepositoryMockRecorder) CreateProduct ¶
func (mr *MockProductRepositoryMockRecorder) CreateProduct(ctx, data any) *gomock.Call
CreateProduct indicates an expected call of CreateProduct.
func (*MockProductRepositoryMockRecorder) DeleteProduct ¶
func (mr *MockProductRepositoryMockRecorder) DeleteProduct(ctx, id any) *gomock.Call
DeleteProduct indicates an expected call of DeleteProduct.
func (*MockProductRepositoryMockRecorder) GetManyProduct ¶
func (mr *MockProductRepositoryMockRecorder) GetManyProduct(ctx, data any) *gomock.Call
GetManyProduct indicates an expected call of GetManyProduct.
func (*MockProductRepositoryMockRecorder) GetManyProductByCategoryID ¶
func (mr *MockProductRepositoryMockRecorder) GetManyProductByCategoryID(ctx, categoryID any) *gomock.Call
GetManyProductByCategoryID indicates an expected call of GetManyProductByCategoryID.
func (*MockProductRepositoryMockRecorder) GetProductByID ¶
func (mr *MockProductRepositoryMockRecorder) GetProductByID(ctx, id any) *gomock.Call
GetProductByID indicates an expected call of GetProductByID.
func (*MockProductRepositoryMockRecorder) UpdateProduct ¶
func (mr *MockProductRepositoryMockRecorder) UpdateProduct(ctx, id, data any) *gomock.Call
UpdateProduct indicates an expected call of UpdateProduct.
type Product ¶
type Product struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description *string `json:"description"`
Price float64 `json:"price"`
CategoryID uuid.UUID `json:"category_id"`
CreatedAt int64 `json:"created_at"`
UpdatedAt *int64 `json:"updated_at"`
}
func NewProduct ¶
func (*Product) MarshalBinary ¶
func (*Product) UnmarshalBinary ¶
type ProductRepository ¶
type ProductRepository interface {
CreateProduct(ctx context.Context, data *Product) (int64, error)
UpdateProduct(ctx context.Context, id uuid.UUID, data *Product) (int64, error)
DeleteProduct(ctx context.Context, id uuid.UUID) (int64, error)
GetProductByID(ctx context.Context, id uuid.UUID) (*Product, error)
GetManyProduct(ctx context.Context, data GetManyProductPayload) ([]*Product, error)
GetManyProductByCategoryID(ctx context.Context, categoryID uuid.UUID) ([]*Product, error)
WithTx(tx sqlutils.SQLTX) ProductRepository
Client() sqlutils.SQLDB
}
TODO