Documentation
¶
Overview ¶
Package main demonstrates fluentfp composition across 7 packages in a curl-testable order processing service.
Run:
go run ./examples/orders/
Then:
curl -s -X POST http://localhost:8080/orders \
-H 'Content-Type: application/json' \
-d '{"customer":"Alice","items":[{"sku":"WIDGET-1","quantity":3}]}'
Trip the circuit breaker with SKU "FAIL-PRICE":
for i in 1 2 3; do curl -s -X POST http://localhost:8080/orders \
-H 'Content-Type: application/json' \
-d '{"customer":"Bob","items":[{"sku":"FAIL-PRICE","quantity":1}]}'; done
curl -s -X POST http://localhost:8080/orders \
-H 'Content-Type: application/json' \
-d '{"customer":"Carol","items":[{"sku":"WIDGET-1","quantity":1}]}'
# → 503: circuit breaker open
Click to show internal directories.
Click to hide internal directories.