Documentation
¶
Overview ¶
Package orderfromcart implements a Google Cloud Function to receive a shopping cart description via a Pub/Sub topic. The handler translates the cart into an order and stores it as an order document under Firestore.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertCartToOrder ¶
func ConvertCartToOrder(cart *pb.ShoppingCart) (*orders.Order, error)
ConvertCartToOrder clones the data of a shopping cart into an order structure
func OrderFromCart ¶
func OrderFromCart(w http.ResponseWriter, r *http.Request)
OrderFromCart is Cloud Function entry point. The payload of the HTTP request is a checked out shopping cart expressed as a base64 encoded Protocol Buffer message wrapped in a JSON envelop.
See https://cloud.google.com/pubsub/docs/push for documentation of the request body JSON content.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.