delivery-service

command module
v0.0.0-...-e18c8c3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

README

Delivery Service

Throughout this course, this application will form a "persistent example" that we can return to to understand the concepts of observability.

⚠️ This README has been written before the actual application, in a documentation first approach. At the time of writing, it is not complete.

Architecture

The application is a RESTful API that you can query to fetch delivery options from different (fake) third-party providers. I mocked the third-party providers and made them generate random results and, occasionally, unexpected failures. The (nonsensical) providers include:

  • svx: Stock Variant Express
  • mmc: Million Mile Company
  • hid: High Inertia Delivery

The application publishes the results of the successful queries to an event stream to mock an "analytics" workflow.

Observability

The application is deliberately written entirely without any telemetric output of any kind. It is an exercise during the course for learners to implement the various types of telemetry and make the application "observable."

Development

Requirements
Build

You can build the application via:

go build

Once built, you can run the application:

./delivery-service

When running, you can open another terminal window and use standard tools (e.g., the browser or curl) to view the result.

curl 'localhost:9093/delivery-options?width=200&height=35&depth=150&weight=2500'

# [
#   {
#     "provider": "svx",
#     "cost": {
#       "total": 590,
#       "currency": "EUR"
#     },
#     "arrival": "2023-09-11T18:00:00.000Z"
#   }
# ]
Test

You can also test the application via:

go test

By default, the tests include tests to validate that the application produces the required observability. I designed this so learners can submit pull requests, making the application "observable," and use the test suite to validate whether their changes are successful.

To test only the application logic, use:

go test -run '!Observe'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
package money is a utility package providing functions to handle money.
package money is a utility package providing functions to handle money.

Jump to

Keyboard shortcuts

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