Documentation ¶
Index ¶
- Variables
- func ConnectToDb(config utils.Config)
- type BuyerRepository
- type BuyerRepositoryImpl
- type OrderRepository
- type OrderRepositoryImpl
- func (repository OrderRepositoryImpl) FindByBuyerId(buyerId uint, limit int, offset int) []model.Order
- func (repository OrderRepositoryImpl) FindById(id uint) model.Order
- func (repository OrderRepositoryImpl) FindBySellerId(sellerId uint, limit int, offset int) []model.Order
- func (repository OrderRepositoryImpl) Save(order model.Order) (model.Order, error)
- func (repository OrderRepositoryImpl) UpdateStatusToAccepted(order model.Order) (model.Order, error)
- type ProductRepository
- type ProductRepositoryImpl
- func (repository ProductRepositoryImpl) FindAll(limit int, offset int) []model.Product
- func (repository ProductRepositoryImpl) FindById(id uint) model.Product
- func (repository ProductRepositoryImpl) FindBySellerId(sellerId uint, limit int, offset int) []model.Product
- func (repository ProductRepositoryImpl) Save(product model.Product) (model.Product, error)
- type SellerRepository
- type SellerRepositoryImpl
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func ConnectToDb ¶
Types ¶
type BuyerRepository ¶
type BuyerRepository interface { Save(buyer model.Buyer) (model.Buyer, error) FindByEmail(email string) (model.Buyer, error) }
func NewBuyerRepository ¶
func NewBuyerRepository() BuyerRepository
type BuyerRepositoryImpl ¶
type BuyerRepositoryImpl struct { }
func (*BuyerRepositoryImpl) FindByEmail ¶
func (repository *BuyerRepositoryImpl) FindByEmail(email string) (model.Buyer, error)
type OrderRepository ¶
type OrderRepository interface { Save(order model.Order) (model.Order, error) FindById(id uint) model.Order FindBySellerId(sellerId uint, limit int, offset int) []model.Order FindByBuyerId(buyerId uint, limit int, offset int) []model.Order UpdateStatusToAccepted(order model.Order) (model.Order, error) }
func NewOrderRepository ¶
func NewOrderRepository() OrderRepository
type OrderRepositoryImpl ¶
type OrderRepositoryImpl struct { }
func (OrderRepositoryImpl) FindByBuyerId ¶
func (OrderRepositoryImpl) FindById ¶
func (repository OrderRepositoryImpl) FindById(id uint) model.Order
func (OrderRepositoryImpl) FindBySellerId ¶
func (OrderRepositoryImpl) UpdateStatusToAccepted ¶
type ProductRepository ¶
type ProductRepository interface { Save(product model.Product) (model.Product, error) FindAll(limit int, offset int) []model.Product FindById(id uint) model.Product FindBySellerId(sellerId uint, limit int, offset int) []model.Product }
func NewProductRepository ¶
func NewProductRepository() ProductRepository
type ProductRepositoryImpl ¶
type ProductRepositoryImpl struct { }
func (ProductRepositoryImpl) FindAll ¶
func (repository ProductRepositoryImpl) FindAll(limit int, offset int) []model.Product
func (ProductRepositoryImpl) FindById ¶
func (repository ProductRepositoryImpl) FindById(id uint) model.Product
func (ProductRepositoryImpl) FindBySellerId ¶
type SellerRepository ¶
type SellerRepository interface { Save(buyer model.Seller) (model.Seller, error) FindByEmail(email string) (model.Seller, error) }
func NewSellerRepository ¶
func NewSellerRepository() SellerRepository
type SellerRepositoryImpl ¶
type SellerRepositoryImpl struct { }
func (SellerRepositoryImpl) FindByEmail ¶
func (s SellerRepositoryImpl) FindByEmail(email string) (model.Seller, error)
Click to show internal directories.
Click to hide internal directories.