libChi

package
v2.0.0-...-51e8ac7 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package libChi provides the v2 chi web framework adapter for requestCore.

chi is used as the default router for the net/http v2 adapter, providing richer routing features (middleware, groups, path parameters) than the standard http.ServeMux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChiRouter

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

ChiRouter implements routing.Router using chi.

func NewRouter

func NewRouter() *ChiRouter

NewRouter creates a new ChiRouter with a new chi.Mux.

func NewRouterFromMux

func NewRouterFromMux(mux *chi.Mux) *ChiRouter

NewRouterFromMux creates a new ChiRouter from an existing chi.Mux.

func (*ChiRouter) Delete

func (r *ChiRouter) Delete(pattern string, handler routing.Handler) error

func (*ChiRouter) Get

func (r *ChiRouter) Get(pattern string, handler routing.Handler) error

func (*ChiRouter) Group

func (r *ChiRouter) Group(prefix string) routing.RouteGroup

Group creates a sub-group with the given prefix.

func (*ChiRouter) Handle

func (r *ChiRouter) Handle(method, pattern string, handler routing.Handler) error

Handle registers a handler for the given method and pattern.

func (*ChiRouter) Head

func (r *ChiRouter) Head(pattern string, handler routing.Handler) error

func (*ChiRouter) MethodNotAllowed

func (r *ChiRouter) MethodNotAllowed(handler routing.Handler)

MethodNotAllowed sets the handler for disallowed methods.

func (*ChiRouter) Native

func (r *ChiRouter) Native() any

Native returns the underlying chi.Mux.

func (*ChiRouter) NotFound

func (r *ChiRouter) NotFound(handler routing.Handler)

NotFound sets the handler for unmatched routes.

func (*ChiRouter) Patch

func (r *ChiRouter) Patch(pattern string, handler routing.Handler) error

func (*ChiRouter) Post

func (r *ChiRouter) Post(pattern string, handler routing.Handler) error

func (*ChiRouter) Put

func (r *ChiRouter) Put(pattern string, handler routing.Handler) error

func (*ChiRouter) SetErrorHandler

func (r *ChiRouter) SetErrorHandler(handler *response.Handler)

SetErrorHandler installs the v2 response handler and error registry used for centralized error dispatch.

func (*ChiRouter) With

func (r *ChiRouter) With(middleware ...routing.Middleware) routing.RouteGroup

With returns a new group with additional middleware.

Jump to

Keyboard shortcuts

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