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 decode product") ErrUserIdIsNotValid = errors.New("this user is not valid") ErrCantUpdateUser = errors.New("can't add this product to the cart") ErrCantRemoveItemCart = errors.New("cannot remove this item from the cart") ErrCantGetItem = errors.New("was unable to get the item from the cart") ErrCantBuyCartItem = errors.New("cannot update the purchase") )
View Source
var 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.