Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutProduct ¶
func CheckoutProduct(conn *pgxpool.Pool, config utils.Config, body models.CheckoutModel, lock *sync.RWMutex)
CheckoutProduct implements the checkout process. Steps as follows - 1. Finds the products against cart [call to cart microservice] 2. Finds the product details [call to product microservice] 3. Allocates the quantity to the customer after successfull payment. Uses the concept of reserve quantity to race condition [assumes dummy payment microservice] Please not this implementation acruire lock also for handling race condition
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.