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 ¶
- type Router
- func (r *Router) Any(path string, chain ...httpx.HandlerFunc)
- func (r *Router) DELETE(path string, chain ...httpx.HandlerFunc)
- func (r *Router) GET(path string, chain ...httpx.HandlerFunc)
- func (r *Router) Group(prefix string, mw ...httpx.HandlerFunc) httpx.Group
- func (r *Router) HEAD(path string, chain ...httpx.HandlerFunc)
- func (r *Router) Handle(method, path string, chain ...httpx.HandlerFunc)
- func (r *Router) NoRoute(chain ...httpx.HandlerFunc)
- func (r *Router) OPTIONS(path string, chain ...httpx.HandlerFunc)
- func (r *Router) PATCH(path string, chain ...httpx.HandlerFunc)
- func (r *Router) POST(path string, chain ...httpx.HandlerFunc)
- func (r *Router) PUT(path string, chain ...httpx.HandlerFunc)
- func (r *Router) Routes() []httpx.RouteInfo
- func (r *Router) Run(addr string) error
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Static(prefix, dir string)
- func (r *Router) Use(mw ...httpx.HandlerFunc)
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 (*Router) NoRoute ¶
func (r *Router) NoRoute(chain ...httpx.HandlerFunc)
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) Use ¶
func (r *Router) Use(mw ...httpx.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.