chi

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() ports.HTTPRouter

New creates a new chi router that implements ports.HTTPRouter.

func NewMiddleware

func NewMiddleware() ports.HTTPMiddleware

NewMiddleware creates a new middleware instance that implements ports.HTTPMiddleware.

func NewMux

func NewMux() *chi.Mux

NewMux creates a new chi.Mux directly.

func NewURLParamExtractor

func NewURLParamExtractor() ports.URLParamExtractor

NewURLParamExtractor creates a new URL parameter extractor.

func URLParam

func URLParam(r *http.Request, key string) string

URLParam is a convenience function for direct usage.

Types

type ChiRouter

type ChiRouter struct {
	*chi.Mux
}

ChiRouter wraps chi.Router to implement our interface.

type Middleware

type Middleware struct{}

Middleware provides common middleware functions.

func (*Middleware) RealIP

func (m *Middleware) RealIP() func(http.Handler) http.Handler

RealIP returns the real IP middleware.

func (*Middleware) Recoverer

func (m *Middleware) Recoverer() func(http.Handler) http.Handler

Recoverer returns the recoverer middleware.

func (*Middleware) RequestID

func (m *Middleware) RequestID() func(http.Handler) http.Handler

RequestID returns the request ID middleware.

type URLParamExtractor

type URLParamExtractor struct{}

URLParamExtractor implements ports.URLParamExtractor.

func (*URLParamExtractor) URLParam

func (u *URLParamExtractor) URLParam(r *http.Request, key string) string

URLParam extracts URL parameters from the request context.

Jump to

Keyboard shortcuts

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