gorouter

gorouter

  • Docs
  • Help
  • GitHub
Project Logo

gorouterGo Server/API micro framework, HTTP request router, multiplexer, mux

package main

import (
    "fmt"
    "log"
    "net/http"

    "github.com/vardius/gorouter/v4"
    "github.com/vardius/gorouter/v4/context"
)

func index(w http.ResponseWriter, _ *http.Request) {
    fmt.Fprint(w, "Welcome!\n")
}

func main() {
    router := gorouter.New()
    router.GET("/", http.HandlerFunc(index))

    log.Fatal(http.ListenAndServe(":8080", router))
}
Documentation
Help
GitHub

Are you looking for a router that can handle deep route trees and large response sizes ?

Pick router that does not slow down with response size and maintains high performance for large and deep route tree.

Most of the router benchmarks out there test only against root route, which does not give a great feedback.

gorouter is designed to scale well against deep route tree. Its architecture allows to keep high performance with low memory usage no matter how deep and big route tree is. Built-in middleware system enables you to build complex solutions keeping performance at its best!

  • extensive set of features
  • compatible with multiple http packages
  • use of native context

allows you to keep your business logic decoupled from external dependencies.

Features

Routing System

Parameters with flexible patterns including regexp wildcards.

Middleware System

Build-in middleware system with order by priority.

Authentication

Easy authentication.

Fast HTTP

Multiple implementations. Support for native net/http or valyala/fasthttp.

Serving Files

Out of box static files serving.

Multidomain

Easy multidomain setup.

HTTP2 Support

Support for HTTP2.

Low memory usage

Efficient and low memory usage, performent and flexible for any response size, no matter depth of the route tree.

gorouter
Docs
DocumentationGoDoc
Community
Support
More
rafallorenz.comGitHubStar
Copyright © 2024 Rafał Lorenz