repository

package
v0.0.0-...-69ebceb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectToDb

func ConnectToDb(config utils.Config)

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)

func (*BuyerRepositoryImpl) Save

func (repository *BuyerRepositoryImpl) Save(buyer model.Buyer) (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 (repository OrderRepositoryImpl) FindByBuyerId(buyerId uint, limit int, offset int) []model.Order

func (OrderRepositoryImpl) FindById

func (repository OrderRepositoryImpl) FindById(id uint) model.Order

func (OrderRepositoryImpl) FindBySellerId

func (repository OrderRepositoryImpl) FindBySellerId(sellerId uint, limit int, offset int) []model.Order

func (OrderRepositoryImpl) Save

func (repository OrderRepositoryImpl) Save(order model.Order) (model.Order, error)

func (OrderRepositoryImpl) UpdateStatusToAccepted

func (repository OrderRepositoryImpl) UpdateStatusToAccepted(order model.Order) (model.Order, error)

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

func (repository ProductRepositoryImpl) FindBySellerId(sellerId uint, limit int, offset int) []model.Product

func (ProductRepositoryImpl) Save

func (repository ProductRepositoryImpl) Save(product model.Product) (model.Product, error)

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)

func (SellerRepositoryImpl) Save

func (s SellerRepositoryImpl) Save(seller model.Seller) (model.Seller, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL