In this chapter, we are going to discuss how Go client applications work in depth. We will explore grequests
, a Python request-style library that allows us to make API calls from the Go code. Then, we will write a client software that uses the GitHub API. In the course of this, we will try to learn about two wonderful libraries called cli
and cobra
. After these fundamentals, we will try to use the knowledge to write an API testing tool on the command line. Then we will see about Redis, an in-memory database which we can use to cache the API responses to backup the data.
In this chapter, we will cover the following topics:
- What is a client software?</li>
- Basics for writing a command-line tool in Go
- Introducing
grequests
, a Python request-like library in Go - Inspecting GitHub REST API from a Go client
- Creating an API client in Go
- Caching an API for later use
- Creating a unit testing tool for the API