Skip to Content
Building RESTful Web services with Go
book

Building RESTful Web services with Go

by Naren Yellavula
December 2017
Intermediate to advanced
316 pages
6h 58m
English
Packt Publishing
Content preview from Building RESTful Web services with Go

What is middleware? 

Middleware is an entity that hooks into a server's request/response processing. The middleware can be defined in many components. Each component has a specific function to perform. Whenever we define the handlers for our URL patterns (as in the last chapter), the request hits the handler and executes the business logic. So virtually all middleware should perform these functions in order:

  1. Process the request before hitting the handler (function)
  2. Process the handler function
  3. Process the response before giving it to the client

We can see the previous points in the form of a visual illustration:

If we observe the diagram ...

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 RESTful Web Services with Go - Second Edition

Hands-On RESTful Web Services with Go - Second Edition

Naren Yellavula
Microservices with Go

Microservices with Go

Alexander Shuiskov

Publisher Resources

ISBN: 9781788294287Supplemental Content