We’ve coded a simple Todo API in the last part: Building APIs with Go — Part 2 Writing our first endpoints | by Fernando H. Bandeira | May, 2021 | Medium
Now we’ll add logging, APM, panic recovery, graceful shutdowns, and error handling to our API.
The code of this part is available on Github: fernandobandeira/go-api at part-3 (github.com)
First, let’s start with our logger and telemetry:
We are using zerolog as our structured logging package. Another good package for this would be the uber zap package. …
We’ve reviewed some frameworks and routers on the previous part: Building APIs with Go — Part 1 Choosing our router | by Fernando H. Bandeira | Apr, 2021 | Medium
Now that we’ve chosen our router, we can proceed and build our first endpoints for the API.
We will be defining a directory structure and building a simple Todo API. As we advance in the series, we’ll be adding extra features to this API.
The code of this part is available on Github: fernandobandeira/go-api at part-2 (github.com)
First, let’s take a look at some architectural standards:
To summarize, the goal…
This post is the start of a series to help you learn and make good decisions about your API in Go.
We’ve been testing different languages, libraries, and coding practices for our product at my current employer. After all of that, we’ve concluded that there’s hardly a language as good as Go to build backend APIs currently. This conclusion applies to our team; you should always consider your decisions with your team in mind.
With that in mind, let’s make it clear that the focus of this series is a good development experience. Still, we don’t want to add unnecessary…
CTO @ Goodworld