chirouter

package
v1.22.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package chirouter is an opt-in chi-backed nexus router. Select it instead of the default stdlib router when you want chi's matching/features. It adds a single dependency (go-chi/chi) and no transitive deps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

func New

func New() *Router

New builds a chi-backed router.

func (*Router) Any

func (r *Router) Any(path string, chain ...httpx.HandlerFunc)

func (*Router) DELETE

func (r *Router) DELETE(path string, chain ...httpx.HandlerFunc)

func (*Router) GET

func (r *Router) GET(path string, chain ...httpx.HandlerFunc)

func (*Router) Group

func (r *Router) Group(prefix string, mw ...httpx.HandlerFunc) httpx.Group

func (*Router) HEAD

func (r *Router) HEAD(path string, chain ...httpx.HandlerFunc)

func (*Router) Handle

func (r *Router) Handle(method, path string, chain ...httpx.HandlerFunc)

func (*Router) NoRoute

func (r *Router) NoRoute(chain ...httpx.HandlerFunc)

func (*Router) OPTIONS

func (r *Router) OPTIONS(path string, chain ...httpx.HandlerFunc)

func (*Router) PATCH

func (r *Router) PATCH(path string, chain ...httpx.HandlerFunc)

func (*Router) POST

func (r *Router) POST(path string, chain ...httpx.HandlerFunc)

func (*Router) PUT

func (r *Router) PUT(path string, chain ...httpx.HandlerFunc)

func (*Router) Routes

func (r *Router) Routes() []httpx.RouteInfo

func (*Router) Run

func (r *Router) Run(addr string) error

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP runs app-wide middleware (Use) around the mux so it fires for EVERY request (gin's engine-level semantics); route chains run inside the match.

func (*Router) Static

func (r *Router) Static(prefix, dir string)

func (*Router) Use

func (r *Router) Use(mw ...httpx.HandlerFunc)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL