We are going to utilize one of the most valuable patterns to learn when building services and websites in Go, something we already explored a little in Chapter 2, Adding User Accounts: wrapping handlers. We have seen how we can wrap
http.Handler types to run code before and after our main handlers execute, and we are going to apply the same technique to
http.HandlerFunc function alternatives.
Most web APIs require clients to register an API key for their application, which they are asked to send along with every request. Such keys have many purposes, ranging from simply identifying which app the requests are coming from to addressing authorization concerns in situations where some apps are only able to do limited ...