Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/go-chi/chi
/ functions
Functions
372 in github.com/go-chi/chi
⨍
Functions
372
◇
Types & classes
57
Function
TestRedirectSlashes
(t *testing.T)
middleware/strip_test.go:102
Function
TestRequestID
(t *testing.T)
middleware/request_id_test.go:20
Function
TestRequestLogger
(t *testing.T)
middleware/logger_test.go:21
Function
TestRequestLoggerReadFrom
(t *testing.T)
middleware/logger_test.go:38
Function
TestRoutePattern
TestRoutePattern tests correct in-the-middle wildcard removals. If user organizes a router like this: (router.go) r.Route("/v1", func(r chi.Router)
context_test.go:24
Function
TestRouterFromMuxWith
(t *testing.T)
mux_test.go:726
Function
TestServeHTTPExistingContext
TODO: a Router wrapper test.. type ACLMux struct { *Mux XX string } func NewACLMux() *ACLMux { return &ACLMux{Mux: NewRouter(), XX: "hihi"} } TO
mux_test.go:1328
Function
TestServerBaseContext
(t *testing.T)
mux_test.go:1817
Function
TestSingleHandler
(t *testing.T)
mux_test.go:1284
Function
TestSplit
(t *testing.T)
middleware/content_charset_test.go:94
Function
TestStripSlashes
(t *testing.T)
middleware/strip_test.go:13
Function
TestStripSlashesInRoute
(t *testing.T)
middleware/strip_test.go:56
Function
TestStripSlashesWithNilContext
This tests a http.Handler that is not chi.Router In these cases, the routeContext is nil
middleware/strip_test.go:203
Function
TestSunset
(t *testing.T)
middleware/sunset_test.go:12
Function
TestThrottleBacklog
(t *testing.T)
middleware/throttle_test.go:17
Function
TestThrottleClientTimeout
(t *testing.T)
middleware/throttle_test.go:58
Function
TestThrottleMaximum
(t *testing.T)
middleware/throttle_test.go:146
Function
TestThrottleTriggerGatewayTimeout
(t *testing.T)
middleware/throttle_test.go:90
Function
TestTree
(t *testing.T)
tree_test.go:10
Function
TestTreeFindPattern
(t *testing.T)
tree_test.go:417
Function
TestTreeMoar
(t *testing.T)
tree_test.go:154
Function
TestTreeRegexMatchWholeParam
(t *testing.T)
tree_test.go:387
Function
TestTreeRegexp
(t *testing.T)
tree_test.go:270
Function
TestTreeRegexpRecursive
(t *testing.T)
tree_test.go:336
Function
TestURLFormat
(t *testing.T)
middleware/url_format_test.go:11
Function
TestURLFormatInSubRouter
(t *testing.T)
middleware/url_format_test.go:52
Function
TestWalker
(t *testing.T)
tree_test.go:512
Function
TestWrapWriterHTTP2
(t *testing.T)
middleware/middleware_test.go:23
Function
TestXForwardForIP
(t *testing.T)
middleware/realip_test.go:35
Function
TestXForwardForXRealIPPrecedence
(t *testing.T)
middleware/realip_test.go:68
Function
TestXRealIP
(t *testing.T)
middleware/realip_test.go:11
Method
Trace
Trace adds the route `pattern` that matches a TRACE http method to execute the `handlerFn` http.HandlerFunc.
mux.go:197
Method
Trace
(pattern string, h http.HandlerFunc)
chi.go:106
Function
URLFormat
URLFormat is a middleware that parses the url extension from a request path and stores it on the context as a string under the key `middleware.URLForm
middleware/url_format.go:46
Method
Unwrap
Unwrap returns the original proxied target.
middleware/wrap_writer.go:64
Method
Unwrap
()
middleware/wrap_writer.go:131
Method
Unwrap
()
middleware/compress.go:380
Method
Update
(w http.ResponseWriter, r *http.Request)
_examples/todos-resource/users.go:42
Method
Update
(w http.ResponseWriter, r *http.Request)
_examples/todos-resource/todos.go:43
Function
UpdateArticle
UpdateArticle updates an existing Article in our persistent store.
_examples/rest/main.go:186
Function
WithValue
WithValue is a middleware that sets a given key/value in a context chain.
middleware/value.go:9
Method
Write
(status, bytes int, header http.Header, elapsed time.Duration, extra interface{})
middleware/logger.go:134
Method
Write
(p []byte)
middleware/compress.go:324
Function
customHandler
(w http.ResponseWriter, r *http.Request)
_examples/custom-handler/main.go:26
Function
debugPrintTree
(parent int, i int, n *node, label byte)
tree_test.go:447
Function
encoderDeflate
(w io.Writer, level int)
middleware/compress.go:392
Function
encoderGzip
(w io.Writer, level int)
middleware/compress.go:384
Method
findEdge
(label byte)
tree.go:821
Function
getArticle
(w http.ResponseWriter, r *http.Request)
_examples/versions/main.go:103
Function
init
()
_examples/custom-method/main.go:10
Function
init
This is entirely optional, but I wanted to demonstrate how you could easily add your own logic to the render.Respond method.
_examples/rest/main.go:258
Function
init
()
middleware/middleware_test.go:18
Function
init
()
middleware/logger.go:166
Function
init
A quick note on the statistics here: we're trying to calculate the chance that two randomly generated base62 prefixes will collide. We use the formula
middleware/request_id.go:46
Function
init
()
middleware/terminal.go:37
Function
listArticles
(w http.ResponseWriter, r *http.Request)
_examples/versions/main.go:71
Function
main
Please see https://github.com/go-chi/httplog for a complete package and example for writing a structured logger on chi built on the Go 1.21+ "log/slog
_examples/logging/main.go:7
Function
main
()
_examples/limits/main.go:21
Function
main
()
_examples/custom-method/main.go:16
Function
main
()
_examples/versions/main.go:22
Function
main
()
_examples/custom-handler/main.go:20
Function
main
()
_examples/todos-resource/main.go:14
Function
main
()
_examples/rest/main.go:55
Function
main
()
_examples/router-walk/main.go:11
Function
main
()
_examples/fileserver/main.go:28
Function
main
()
_examples/graceful/main.go:17
Function
main
()
_examples/hello-world/main.go:10
Function
paginate
paginate is a stub, but very possible to implement middleware logic to handle the request params for handling a paginated request.
_examples/rest/main.go:248
Function
panickingHandler
(http.ResponseWriter, *http.Request)
middleware/recoverer_test.go:13
Function
randomErrorMiddleware
(next http.Handler)
_examples/versions/main.go:142
Method
routeHTTP
routeHTTP routes a http.Request through the Mux routing tree to serve the matching handler for a particular http method.
mux.go:426
Function
setPathValue
setPathValue sets the path values in the Request value based on the provided request context. setPathValue is only supported in Go 1.22 and above so
path_value_fallback.go:18
← previous
301–372 of 372, ranked by callers