Documentation ¶
Index ¶
- Variables
- func AddProductToCart(ctx context.Context, productsCollection, usersCollection *mongo.Collection, ...) error
- func BuyItemFromCart(ctx context.Context, usersCollection *mongo.Collection, userID string) error
- func DatabaseConnect() *mongo.Client
- func InstantBuyer(ctx context.Context, productsCollection, usersCollection *mongo.Collection, ...) error
- func OpenCollection(collectionName string) *mongo.Collection
- func RemoveItemFromCart(ctx context.Context, usersCollection *mongo.Collection, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProductNotFound = errors.New("product not found in database") ErrFailedToDecodeProducts = errors.New("cannot decode products into slice") ErrInvalidUserID = errors.New("user is not valid") ErrFailedToUpdateUser = errors.New("cannot add product to cart") ErrCannotBuyCartItem = errors.New("cannot update the purchase") ErrFailedToRemoveItem = errors.New("cannot remove item from cart") )
Functions ¶
func AddProductToCart ¶
func BuyItemFromCart ¶
func DatabaseConnect ¶
func InstantBuyer ¶
func OpenCollection ¶
func OpenCollection(collectionName string) *mongo.Collection
func RemoveItemFromCart ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.