Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

The services behind the facade

Before we dive deeper into the inner workings of the price calculator, let's spend a bit of time examining how the two microservice dependencies work; after all, we will need this information to write our tests.

The price microservice provides a REST endpoint for retrieving an item's published price on a particular date. The service responds with a JSON payload that looks like this:

{
    "price": 10.0,
    "currency": "GBP"
}

The second microservice in this example is called vat and is also RESTful. It exposes an endpoint for retrieving the VAT rate that was applicable on a particular date. The service responds with a JSON payload as follows:

{
    "vat_rate": 0.29
}

As you can see, the returned JSON payload is quite ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content