Echo Quick Start Guide

Book description

Echo is a leading framework for creating web applications with the Go language. This book will show you how to develop scalable real-world web apps, RESTful services, and backend systems with Echo.

About This Book
  • The easiest way to learn how to build web apps with Echo
  • Build a full working project
  • For Go developers with only basic web development knowledge required
Who This Book Is For

You will need to know the basics of the Go language, and the general concepts of web development.

What You Will Learn
  • Key design considerations for high performance Echo applications
  • How Echo handles routing
  • How context is managed through the lifetime of the request and response pipeline
  • Decrease complexity of your apps by developing middleware functions
  • Interact with the request through request data bindings
  • Interact with the response through response data renderings within the framework
  • Use Echo's logging and error handling facilities
  • Render Go templates within Echo to allow for server side rendering of content
In Detail

Echo is a leading framework for creating web applications with the Go language. This book will show you how to develop scalable real-world web apps, RESTful services, and backend systems with Echo.

After a thorough understanding of the basics, you'll be introduced to all the concepts for a building real-world web system with Echo. You will start with the the Go HTTP standard library, and setting up your work environment. You will move on to Echo handlers, group routing, data binding, and middleware processing. After that, you will learn how to test your Go application and use templates.

By the end of this book you will be able to build your very own high performance apps using Echo.

A Quick Start Guide is a focussed, shorter title which provides a faster paced introduction to a technology. They are for people who don't need all the detail at this point in their learning curve. The presentation has been streamlined to concentrate on the things you really need to know, rather than everything.

Style and approach

This book creates a working example of a web application written with the Echo framework, and shows you enough of Echo to give context for a developer to bootstrap a high performance web application with the smallest amount of development time.

Publisher resources

Download Example Code

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Echo Quick Start Guide
  3. Dedication
  4. Packt Upsell
    1. Why subscribe?
  5. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Code in Action
      4. Conventions used
    4. Get in touch
      1. Reviews
  7. Understanding HTTP, Go, and Echo
    1. Technical requirements
    2. HTTP basics
      1. HTTP request
      2. HTTP response
    3. Go HTTP handlers
    4. Go HTTP web server
    5. Reasons for a framework
    6. Setting up the environment
    7. Setting up Echo
    8. Summary
  8. Developing Echo Projects
    1. Technical requirements
    2. Setting up a project in echo and organizing code
      1. Implementing a project
      2. Dependency management
    3. Routing and handlers
      1. Routing
      2. Handlers
    4. Middleware
      1. Custom middleware
    5. Rendering
    6. Summary
  9. Exploring Routing Capabilities
    1. Technical requirements
    2. Basic handler routing
      1. Adding routes
      2. How Echo routing works
    3. Group routing
    4. Router implementation considerations
    5. In action
    6. Summary
  10. Implementing Middleware
    1. Technical requirements
    2. Basics of middleware processing
    3. Middleware chaining
    4. Creating custom middleware
    5. In action
    6. Summary
  11. Utilizing the Request Context and Data Bindings
    1. Technical requirements
    2. Maintaining context
      1. Globally requesting context mapping
      2. The new handler function type
      3. Hiding context within a request
      4. Post Go 1.7
      5. Echo context
    3. Request binding
    4. Response rendering
      1. echo.Response
    5. Summary
  12. Performing Logging and Error Handling
    1. Technical requirements
    2. Logging
      1. Echo's Logger interface
      2. Log levels
      3. Logger middleware
    3. Error handling
      1. Handling application panics
    4. Summary
  13. Testing Applications
    1. Technical requirements
    2. Types of testing
      1. Unit testing
      2. Benchmark testing
      3. Behavior testing
      4. Integration testing
      5. Security testing
    3. Unit testing middleware and handler code
    4. Benchmark testing web applications
    5. External behavior and integration testing
    6. Summary
  14. Providing Templates and Static Content
    1. Technical requirements
    2. Serving static files
    3. Template basics
    4. Templates within Echo
    5. Calling Echo from templates
    6. Summary
  15. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Echo Quick Start Guide
  • Author(s): J. Ben Huson
  • Release date: May 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789139433