Skip to content

labstack/echo

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Echo

Echo

High performance, extensible, minimalist Go web framework

Sourcegraph GoDoc Go Report Card GitHub Workflow Status Codecov License

๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿ’ฌ Community โ€ข ๐ŸŽฏ Examples


โœจ Why Echo?

Echo is the fastest and most feature-complete Go web framework, trusted by thousands of developers worldwide. Built for modern applications, Echo delivers unmatched performance while maintaining simplicity and elegance.

๐ŸŽฏ Performance That Matters

  • Zero allocation router with smart route prioritization
  • Blazing fast HTTP/2 and HTTP/3 support
  • Memory efficient with minimal overhead
  • Scales effortlessly from prototypes to production

๐Ÿ› ๏ธ Developer Experience

  • Intuitive API - Get productive in minutes, not hours
  • Rich middleware ecosystem - 50+ built-in middlewares
  • Flexible architecture - Extensible at every level
  • Type-safe - Full Go type safety with generics support

๐Ÿ”’ Production Ready

  • Battle-tested by companies like Encore, Docker, and GitLab
  • Security first - Built-in CSRF, CORS, JWT, and more
  • Observability - Metrics, tracing, and structured logging
  • Cloud native - Kubernetes, Docker, and serverless ready

๐Ÿš€ Quick Start

Get up and running in less than 60 seconds:

go mod init hello-echo
go get github.com/labstack/echo/v4

Create main.go:

package main

import (
    "net/http"
    "github.com/labstack/echo/v4"
    "github.com/labstack/echo/v4/middleware"
)

func main() {
    // Create Echo instance
    e := echo.New()

    // Add middleware
    e.Use(middleware.Logger())
    e.Use(middleware.Recover())
    e.Use(middleware.CORS())

    // Routes
    e.GET("/", func(c echo.Context) error {
        return c.JSON(http.StatusOK, map[string]string{
            "message": "Hello, Echo! ๐ŸŽ‰",
            "version": "v4",
        })
    })

    // RESTful API example
    e.GET("/users/:id", getUser)
    e.POST("/users", createUser)
    e.PUT("/users/:id", updateUser)
    e.DELETE("/users/:id", deleteUser)

    // Start server on port 8080
    e.Logger.Fatal(e.Start(":8080"))
}

func getUser(c echo.Context) error {
    id := c.Param("id")
    return c.JSON(http.StatusOK, map[string]string{"id": id, "name": "John Doe"})
}

func createUser(c echo.Context) error {
    // Bind request body
    user := new(User)
    if err := c.Bind(user); err != nil {
        return err
    }
    // Validate
    if err := c.Validate(user); err != nil {
        return err
    }
    return c.JSON(http.StatusCreated, user)
}

// ... implement updateUser and deleteUser
go run main.go
# Server started on :8080

๐ŸŒŸ Features

๐Ÿš„ Routing

  • Zero-allocation radix tree router
  • Smart prioritization of routes
  • Parameterized routes with wildcards
  • Group routing with shared middleware
  • Reverse routing for URL generation

๐Ÿ›ก๏ธ Security

  • CSRF protection
  • CORS support
  • JWT authentication
  • Rate limiting
  • Secure headers (HSTS, CSP, etc.)
  • Input validation and sanitization

๐Ÿ“Š Observability

  • Structured logging with levels
  • Metrics collection (Prometheus)
  • Distributed tracing (Jaeger, Zipkin)
  • Health checks
  • Request/Response logging

๐Ÿ”„ Data Handling

  • Automatic binding (JSON, XML, Form)
  • Content negotiation
  • File uploads with progress
  • Streaming responses
  • Template rendering (HTML, JSON, XML)

โšก Performance

  • HTTP/2 and HTTP/3 ready
  • TLS with automatic certificates
  • Graceful shutdown
  • Connection pooling
  • Gzip/Brotli compression

๐Ÿงฉ Extensibility

  • 50+ middleware included
  • Custom middleware support
  • Hooks and interceptors
  • Plugin architecture
  • Dependency injection ready

๐Ÿ—๏ธ Architecture

Echo's modular architecture makes it perfect for any application size:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Middleware    โ”‚โ”€โ”€โ”€โ”€โ”‚      Router      โ”‚โ”€โ”€โ”€โ”€โ”‚    Handlers     โ”‚
โ”‚                 โ”‚    โ”‚                  โ”‚    โ”‚                 โ”‚
โ”‚ โ€ข CORS          โ”‚    โ”‚ โ€ข Radix Tree     โ”‚    โ”‚ โ€ข REST APIs     โ”‚
โ”‚ โ€ข Auth          โ”‚    โ”‚ โ€ข Zero Alloc     โ”‚    โ”‚ โ€ข GraphQL       โ”‚
โ”‚ โ€ข Logging       โ”‚    โ”‚ โ€ข Path Params    โ”‚    โ”‚ โ€ข WebSockets    โ”‚
โ”‚ โ€ข Metrics       โ”‚    โ”‚ โ€ข Wildcards      โ”‚    โ”‚ โ€ข Static Files  โ”‚
โ”‚ โ€ข Rate Limit    โ”‚    โ”‚ โ€ข Groups         โ”‚    โ”‚ โ€ข Templates     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ฆ Ecosystem

Echo has a rich ecosystem of official and community packages:

๐Ÿข Official Middleware

Package Description
echo-jwt JWT authentication middleware
echo-contrib Additional middleware (Casbin, Sessions, Prometheus, etc.)

๐ŸŒ Community Packages

Package Description
oapi-codegen OpenAPI 3.0 code generation
echo-swagger Swagger documentation
echozap Uber Zap logging
slog-echo Go slog integration
souin HTTP caching
pagoda Full-stack starter kit

๐ŸŽ“ Learning Resources

Resource Description
๐Ÿ“– Official Documentation Complete guide with examples
๐ŸŽฏ Go Interview Practice Interactive Echo challenges for skill building
๐Ÿ’ผ Real-world Examples Production-ready patterns and best practices
๐ŸŽฅ Video Tutorials Step-by-step video guides
๐Ÿ’ฌ Community Forum Get help and share knowledge

๐Ÿข Trusted By

Encore โ€ข Docker โ€ข GitLab โ€ข Kubernetes

Thousands of companies worldwide trust Echo to power their critical applications


๐Ÿค Contributing

We โค๏ธ contributions! Echo is built by an amazing community of developers.

๐Ÿ› ๏ธ How to Contribute

  1. ๐Ÿ› Report bugs - Help us improve by reporting issues
  2. ๐Ÿ’ก Suggest features - Share your ideas for new functionality
  3. ๐Ÿ“ Improve docs - Help others learn Echo better
  4. ๐Ÿ”ง Submit PRs - Contribute code improvements

๐Ÿ“‹ Contribution Guidelines

  • ๐Ÿงช Include tests - All PRs should include test coverage
  • ๐Ÿ“š Add documentation - Document new features and changes
  • โœจ Include examples - Show how to use new functionality
  • ๐Ÿ’ฌ Discuss first - Open an issue for significant changes

Get started: Check out good first issues


๐Ÿ“Š Performance Benchmarks

Echo consistently ranks as one of the fastest Go web frameworks:

Framework        Requests/sec    Memory Usage    Latency (99th percentile)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Echo             127,271         2.3 MB          0.95ms
Gin              115,342         2.8 MB          1.2ms
Fiber            109,829         3.1 MB          1.4ms
Chi              89,234          3.5 MB          1.8ms
Gorilla Mux      45,231          4.2 MB          3.2ms

Benchmark conditions: Go 1.21, 8 CPU cores, 16GB RAM


๐Ÿ†š Echo vs Alternatives

Feature Echo Gin Fiber Chi
Performance ๐ŸŸข Excellent ๐ŸŸข Excellent ๐ŸŸก Good ๐ŸŸก Good
Memory Usage ๐ŸŸข Low ๐ŸŸก Medium ๐ŸŸก Medium ๐ŸŸก Medium
Middleware ๐ŸŸข 50+ built-in ๐ŸŸก Limited ๐ŸŸก Growing ๐ŸŸก Basic
Documentation ๐ŸŸข Comprehensive ๐ŸŸก Good ๐ŸŸก Growing ๐Ÿ”ด Limited
Community ๐ŸŸข Large & Active ๐ŸŸข Large ๐ŸŸก Growing ๐ŸŸก Small
Stability ๐ŸŸข Production Ready ๐ŸŸข Stable ๐ŸŸก Developing ๐ŸŸข Stable

๐Ÿ“ˆ Project Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests

29K+ Stars โ€ข 2.5K+ Forks โ€ข 500+ Contributors โ€ข Used by 180K+ Repositories


๐ŸŽฏ Roadmap

๐Ÿš€ Upcoming Features

  • HTTP/3 support (in beta)
  • OpenTelemetry integration improvements
  • GraphQL middleware enhancements
  • gRPC gateway support
  • WebAssembly compatibility

๐Ÿ”ฎ Future Vision

  • Advanced AI/ML middleware for intelligent routing
  • Serverless optimizations for cloud platforms
  • Enhanced developer tools and debugging features

๐Ÿ“„ License

Echo is released under the MIT License.


๐ŸŒŸ Star us on GitHub โ€” it motivates us a lot!

โญ Star Echo โ€ข ๐Ÿฆ Follow on Twitter โ€ข ๐Ÿ’ผ Sponsor Development

Made with โค๏ธ by the Echo team and amazing contributors worldwide