Documentation ¶
Overview ¶
database queries for cart operations.
payment information processing queries.
product database operations.
user database operations. (login, registration, etc.)
Index ¶
- type CartRepository
- type CheckoutRepository
- type LogRepository
- type MongoCartRepository
- type MongoCheckoutRepo
- type MongoLogRepo
- type MongoProductRepo
- func (repo *MongoProductRepo) AddProduct(product models.Product) error
- func (r *MongoProductRepo) FindProductByID(productID string) (*models.Product, error)
- func (repo *MongoProductRepo) GetAllProducts() ([]models.Product, error)
- func (repo *MongoProductRepo) SearchProducts(keyword string) ([]models.Product, error)
- type MongoUserRepo
- type ProductRepository
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartRepository ¶
type CheckoutRepository ¶
type LogRepository ¶
type MongoCartRepository ¶
type MongoCartRepository struct {
Collection *mongo.Collection
}
func NewMongoCartRepository ¶
func NewMongoCartRepository(database, collection string) *MongoCartRepository
func (*MongoCartRepository) DeleteCartByUserID ¶
func (r *MongoCartRepository) DeleteCartByUserID(userID string) error
func (*MongoCartRepository) FindCartByUserID ¶
func (r *MongoCartRepository) FindCartByUserID(userID string) (*models.Cart, error)
type MongoCheckoutRepo ¶
type MongoCheckoutRepo struct {
Collection *mongo.Collection
}
func NewMongoCheckoutRepo ¶
func NewMongoCheckoutRepo(database, collection string) *MongoCheckoutRepo
func (*MongoCheckoutRepo) SaveCheckout ¶
func (repo *MongoCheckoutRepo) SaveCheckout(checkout models.Checkout) error
type MongoLogRepo ¶
type MongoLogRepo struct {
Collection *mongo.Collection
}
func NewMongoLogRepo ¶
func NewMongoLogRepo(database, collection string) *MongoLogRepo
func (*MongoLogRepo) LogAttack ¶
func (repo *MongoLogRepo) LogAttack(attackType, details, ip string) error
type MongoProductRepo ¶
type MongoProductRepo struct {
Collection *mongo.Collection
}
func NewMongoProductRepo ¶
func NewMongoProductRepo(database, collection string) *MongoProductRepo
func (*MongoProductRepo) AddProduct ¶
func (repo *MongoProductRepo) AddProduct(product models.Product) error
func (*MongoProductRepo) FindProductByID ¶
func (r *MongoProductRepo) FindProductByID(productID string) (*models.Product, error)
func (*MongoProductRepo) GetAllProducts ¶
func (repo *MongoProductRepo) GetAllProducts() ([]models.Product, error)
func (*MongoProductRepo) SearchProducts ¶
func (repo *MongoProductRepo) SearchProducts(keyword string) ([]models.Product, error)
type MongoUserRepo ¶
type MongoUserRepo struct {
Collection *mongo.Collection
}
func NewMongoUserRepo ¶
func NewMongoUserRepo(database, collection string) *MongoUserRepo
func (*MongoUserRepo) CreateUser ¶
func (repo *MongoUserRepo) CreateUser(user models.User) error
func (*MongoUserRepo) GetUserByUserName ¶
func (repo *MongoUserRepo) GetUserByUserName(username string) (models.User, error)
type ProductRepository ¶
Click to show internal directories.
Click to hide internal directories.