Let’s Go Further! Advanced patterns for building APIs and web applications in Go
Written for: Go 1.23
Last updated: August 19th, 2024
Formats: HTML, PDF and ePUB
Language 语言: US English
Size: 575 pages (in PDF format)
Version: 1.23.0
What You’ll Learn…
1
Structure and organization — How to implement an idiomatic and flexible code structure for your RESTful API projects.
2
JSON responses — How to send JSON responses from your API, how to format and customize them, and what common gotchas you need to be aware of.
3
JSON requests — How to parse incoming JSON requests, manage bad requests, and restrict and validate their content.
4
SQL migrations — How to use SQL migrations to manage changes to your database schema.
5
Database operations — How to set timeouts on your database queries and optimize the behavior of Go’s sql.DB connection pool.
6
Beyond CRUD — How to perform advanced actions on your API resources, including fetching related data and partial updates (with optimistic concurrency control).
7
Filtering, sorting and pagination — How to support filtering, sorting and pagination of data in your API endpoints.
8
Full-text search — How to use PostgreSQL’s full-text search functionality to perform natural-language searches of your data.
9
Rate-limiting — How to limit requests to your API on a per-client basis.
10
Managing background tasks — How to safely execute tasks in background goroutines.
11
Graceful shutdown — How to set up your API to support graceful shutdowns, including waiting for background tasks to complete.
12
Sending emails — How to send emails from your API and manage email content using Go’s new embedded files functionality.
13
User activation and password resets — How to build secure workflows for registering users, verifying their email address, and managing password resets.
14
Authentication — How to authenticate users with both stateful bearers tokens and stateless JWTs (JSON web tokens).
15
Permission-based authorization — How to implement granular permission-based authorization checks on your API endpoints.
16
Managing CORS requests — How to control cross-origin requests to your API from front-end JavaScript applications.
17
Metrics — How to expose application metrics, including memory use, sql.DB connection pool statistics, response status counts and more.
18
Building and auditing — How to combine Go’s tooling and Makefiles to easily audit your code, build binaries and vendor dependencies.
19
Versioning — How to leverage Git to apply automatic application versioning when building binaries.
20
Deployment — How to set up a Linux server on Digital Ocean, automate deployments, and run your API as a background service in production using systemd.
About the Author
Hey, I’m Alex Edwards, a full-stack web developer and author of Let’s Go and Let’s Go Further. I live near Innsbruck, Austria.
I’ve been working with Go for over 10 years, building production applications for commercial clients and myself (including the website that you’re reading now!) and helping people all around the world improve their Go skills.
You can see more of my writing on my blog (where I publish detailed tutorials), some of my open-source work on GitHub, and you can also follow me on Instagram and Twitter.
Amazon page