Skip to content

A unified HTTP framework abstraction layer for Go that provides a consistent interface across multiple popular web frameworks.

Notifications You must be signed in to change notification settings

go-sphere/httpx

Repository files navigation

httpx

A unified HTTP framework abstraction layer for Go that provides a consistent interface across multiple popular web frameworks.

Overview

httpx is designed to provide a framework-agnostic HTTP handling layer that allows you to write application logic once and run it on any supported HTTP framework. It currently supports:

  • Gin (ginx) - Fast HTTP web framework
  • Fiber (fiberx) - Express inspired web framework
  • Echo (echox) - High performance, minimalist framework
  • Hertz (hertzx) - High-performance HTTP framework by CloudWego

Testing

The project provides a single conformance test suite under conformance/. It uses ginx as the baseline behavior and checks that other adapters (fiberx, echox, hertzx) match it.

Run tests:

# Run conformance tests
go test ./conformance/... -v

# Run with coverage
go test ./conformance/... -cover

Router Feature Detection

httpx exposes optional router capability detection through helper functions.

supports := httpx.SupportsNamedWildcard(router)

Currently supported router feature keys:

  • httpx.RouterFeatureNamedWildcard - named wildcard params in route path patterns, e.g. /*filepath

Feature values are adapter declarations and can be extended in future versions.

License

This project is licensed under the MIT License - see the LICENSE file for details. (https://github.com/go-sphere/httpx/discussions)

About

A unified HTTP framework abstraction layer for Go that provides a consistent interface across multiple popular web frameworks.

Resources

Stars

Watchers

Forks

Packages

No packages published