api

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2022 License: BSD-2-Clause Imports: 14 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL