stdrouter

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: 3 Imported by: 0

Documentation

Overview

Package stdrouter is the DEFAULT nexus router: Go 1.22's net/http.ServeMux behind the httpx.Router seam, with zero third-party dependencies. The default nexus binary therefore links no external router at all. gin and chi remain available as opt-in backends (httpx/ginrouter, httpx/chirouter).

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 the default stdlib-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 — including ones the mux would 404/405 (gin's engine-level middleware semantics). Route-specific chains run inside the matched handler afterward.

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