← Winnitude! Search  ·  Reader Mode (1036 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
ECHO · 45 LINKS

Echo

Echo

Build fast Go APIs.
Without the bloat.

A high-performance, minimalist Go web framework with a zero-allocation router, batteries-included middleware and an expressive API.

Get started 32.9k on GitHub
go get github.com/labstack/echo/v5

Building a multi-tenant API? Echo Pro adds API keys, tenant isolation, quotas and signed webhooks.

server.go ยท excerpt
e := echo.New()

// Middleware
e.Use(middleware.RequestLogger())
e.Use(middleware.Recover())

// Route => handler
e.GET("/", func(c *echo.Context) error {
  return c.String(http.StatusOK, "Hello, World!\n")
})

Built on Echo

See all adopters 32.9k GitHub stars 0 allocs router, per request 25+ built-in middlewares MIT open source license

Features

Optimized router

Radix-tree router; matching a route allocates no memory with default settings. Static paths match before parameters, parameters before wildcards.

Middleware

CORS, CSRF, rate limiting, gzip, recover and request logging ship in Echo's middleware package. JWT, sessions and metrics are official add-ons.

Data binding

Bind JSON, XML or form bodies and path parameters into a struct with one call to c.Bind. The binding guide covers query parameters.

TLS and HTTP/2

StartConfig.StartTLS serves HTTPS from certificate files, or set StartConfig.TLSConfig and call Start. HTTP/2 works over TLS by default.

Extensible

Write middleware as a plain function. Replace the binder, validator, renderer, IP extractor or error handler.

Templates

Use echo.TemplateRenderer for html/template, or set e.Renderer to any engine that implements echo.Renderer.

Quickstart

  1. Install

    Create a module and add Echo.

    go mod init myapp
    go get github.com/labstack/echo/v5
    
  2. Write

    Create server.go with one route. The full example adds imports and main.

    e.GET("/", func(c *echo.Context) error {
      return c.String(http.StatusOK, "Hello, World!\n")
    })
    
  3. Run

    Fetch dependencies and start serving on port 1323.

    go mod tidy
    go run server.go
    

Official packages

echo-jwt JWT authentication middleware backed by golang-jwt. echo-otel OpenTelemetry tracing and metrics middleware. echo-prometheus Prometheus metrics middleware. echo-contrib Casbin, sessions, pprof and tracing helpers.

Sponsors

Blacksmith Faster, drop-in GitHub Actions runners. Encore The platform for building Go-based cloud backends. Customer.io Gravity Carbon Codeerror Become a sponsor

Echo stays MIT. Echo Pro is a separate commercial library that funds it.

Production building blocks for teams running multi-tenant APIs on Echo v5.

Auth and tenant isolation API keys, JWT access tokens and deny-by-default tenant authorizers. Quotas and usage metering Per-tenant plans, AI and MCP metering, and Stripe meter export. Audit, webhooks and execution records Durable evidence, signed delivery and records of external effects. Embedded admin console Plans, usage, audit and outbox views behind your own sign-in. Explore Echo Pro See pricing

Site links

echo

High performance, extensible, minimalist Go web framework.

Docs

Quickstart Routing Middleware Cookbook

Project

GitHub Releases Discussions Contributing

Resources

API Reference Sponsor MIT License