Documentation ¶
Index ¶
- Variables
- func AddProductToCart(ctx context.Context, prodCollection, userCollection *mongo.Collection, ...) error
- func BuyItemFromCart(ctx context.Context, userCollection *mongo.Collection, userID string) error
- func DBSet() *mongo.Client
- func InstantBuyer(ctx context.Context, prodCollection, userCollection *mongo.Collection, ...) error
- func ProductData(client *mongo.Client, CollectionName string) *mongo.Collection
- func RemoveCartItem(ctx context.Context, prodCollection, userCollection *mongo.Collection, ...) error
- func UserData(client *mongo.Client, CollectionName string) *mongo.Collection
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCantFindProduct = errors.New("can't find product") ErrCantDecodeProducts = errors.New("can't find product") ErrUserIDIsNotValid = errors.New("user is not valid") ErrCantUpdateUser = errors.New("cannot add product to cart") ErrCantRemoveItem = errors.New("cannot remove item from cart") ErrCantGetItem = errors.New("cannot get item from cart ") ErrCantBuyCartItem = errors.New("cannot update the purchase") )
View Source
var Client *mongo.Client = DBSet()
Functions ¶
func AddProductToCart ¶
func BuyItemFromCart ¶
func InstantBuyer ¶
func ProductData ¶
func ProductData(client *mongo.Client, CollectionName string) *mongo.Collection
func RemoveCartItem ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.