Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/go-chi/chi
/ functions
Functions
435 in github.com/go-chi/chi
⨍
Functions
435
◇
Types & classes
60
Function
TestGetClientIPAddr_RoundTrip
(t *testing.T)
middleware/client_ip_test.go:334
Function
TestGetClientIPAddr_Unset
(t *testing.T)
middleware/client_ip_test.go:324
Function
TestGetHead
(t *testing.T)
middleware/get_head_test.go:11
Function
TestHttp2FancyWriterRemembersWroteHeaderWhenFlushed
(t *testing.T)
middleware/wrap_writer_test.go:34
Function
TestHttpFancyWriterReadFromByteCountWithTee
TestHttpFancyWriterReadFromByteCountWithTee is a regression test for https://github.com/go-chi/chi/issues/1067. httpFancyWriter.ReadFrom was adding n
middleware/wrap_writer_test.go:108
Function
TestHttpFancyWriterReadFromHonorsDiscard
TestHttpFancyWriterReadFromHonorsDiscard verifies that Discard() suppresses the body even when it is written via ReadFrom/io.Copy. Before the fix, the
middleware/wrap_writer_test.go:131
Function
TestHttpFancyWriterRemembersWroteHeaderWhenFlushed
(t *testing.T)
middleware/wrap_writer_test.go:25
Function
TestInvalidIP
(t *testing.T)
middleware/realip_test.go:93
Function
TestMethodNotAllowed
(t *testing.T)
mux_test.go:394
Function
TestMiddlewarePanicOnLateUse
(t *testing.T)
mux_test.go:1452
Function
TestMountingExistingPath
(t *testing.T)
mux_test.go:1474
Function
TestMountingSimilarPattern
(t *testing.T)
mux_test.go:1489
Function
TestMuxBasic
(t *testing.T)
mux_test.go:16
Function
TestMuxBig
(t *testing.T)
mux_test.go:889
Function
TestMuxComplicatedNotFound
(t *testing.T)
mux_test.go:501
Function
TestMuxContextIsThreadSafe
(t *testing.T)
mux_test.go:1689
Function
TestMuxEmptyParams
(t *testing.T)
mux_test.go:1516
Function
TestMuxEmptyRoutes
(t *testing.T)
mux_test.go:266
Function
TestMuxFind
(t *testing.T)
mux_test.go:1926
Function
TestMuxHandlePatternValidation
(t *testing.T)
mux_test.go:646
Function
TestMuxMatch
(t *testing.T)
mux_test.go:1862
Function
TestMuxMatch_DoesNotHaveBasePath
(t *testing.T)
mux_test.go:1915
Function
TestMuxMatch_HasBasePath
(t *testing.T)
mux_test.go:1900
Function
TestMuxMiddlewareStack
(t *testing.T)
mux_test.go:758
Function
TestMuxMissingParams
(t *testing.T)
mux_test.go:1536
Function
TestMuxMounts
(t *testing.T)
mux_test.go:208
Function
TestMuxNestedMethodNotAllowed
(t *testing.T)
mux_test.go:435
Function
TestMuxNestedNotFound
(t *testing.T)
mux_test.go:316
Function
TestMuxPlain
(t *testing.T)
mux_test.go:245
Function
TestMuxRegexp
(t *testing.T)
mux_test.go:1584
Function
TestMuxRegexp2
(t *testing.T)
mux_test.go:1600
Function
TestMuxRegexp3
(t *testing.T)
mux_test.go:1616
Function
TestMuxRouteGroups
(t *testing.T)
mux_test.go:833
Function
TestMuxSubrouterWildcardParam
(t *testing.T)
mux_test.go:1657
Function
TestMuxSubroutes
(t *testing.T)
mux_test.go:1181
Function
TestMuxSubroutesBasic
(t *testing.T)
mux_test.go:1100
Function
TestMuxTrailingSlash
Test a mux that routes a trailing slash, see also middleware/strip_test.go for an example of using a middleware to handle trailing slashes.
mux_test.go:285
Function
TestMuxWildcardRoute
(t *testing.T)
mux_test.go:1558
Function
TestMuxWildcardRouteCheckTwo
(t *testing.T)
mux_test.go:1571
Function
TestMuxWith
(t *testing.T)
mux_test.go:593
Function
TestNestedGroups
(t *testing.T)
mux_test.go:1396
Function
TestPathValue
(t *testing.T)
path_value_test.go:10
Function
TestPattern
(t *testing.T)
pattern_test.go:9
Function
TestPattern
(t *testing.T)
middleware/route_headers_test.go:187
Function
TestQueryHTTPMethod
(t *testing.T)
mux_test.go:1811
Function
TestRecoverer
(t *testing.T)
middleware/recoverer_test.go:19
Function
TestRecovererAbortHandler
(t *testing.T)
middleware/recoverer_test.go:78
Function
TestRecovererNoColor
(t *testing.T)
middleware/recoverer_test.go:48
Function
TestRedirectSlashes
(t *testing.T)
middleware/strip_test.go:102
Function
TestRedirectSlashes_PreventBackslashRelativeOpenRedirect
(t *testing.T)
middleware/strip_test.go:276
Function
TestReplaceWildcardsConsecutive
TestReplaceWildcardsConsecutive ensures multiple consecutive wildcards are collapsed into a single slash.
context_test.go:97
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
TestRouteHeaders
(t *testing.T)
middleware/route_headers_test.go:10
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:738
Function
TestRoutesHidesMountStub
https://github.com/go-chi/chi/issues/830 Routes() must not leak the synthetic stub handler Mount() installs on its mount pattern: a plain Mount()/Rou
tree_test.go:616
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:1340
Function
TestServerBaseContext
(t *testing.T)
mux_test.go:2010
Function
TestSingleHandler
(t *testing.T)
mux_test.go:1296
Function
TestSplit
(t *testing.T)
middleware/content_charset_test.go:94
Function
TestStripPrefix
(t *testing.T)
middleware/strip_test.go:241
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
TestThrottleCustomStatusCode
(t *testing.T)
middleware/throttle_test.go:264
Function
TestThrottleMaximum
(t *testing.T)
middleware/throttle_test.go:144
Function
TestThrottleRetryAfter
(t *testing.T)
middleware/throttle_test.go:202
Function
TestThrottleTriggerGatewayTimeout
(t *testing.T)
middleware/throttle_test.go:90
Function
TestTree
(t *testing.T)
tree_test.go:12
Function
TestTreeFindPattern
(t *testing.T)
tree_test.go:419
Function
TestTreeMoar
(t *testing.T)
tree_test.go:156
Function
TestTreeRegexMatchWholeParam
(t *testing.T)
tree_test.go:389
Function
TestTreeRegexp
(t *testing.T)
tree_test.go:272
Function
TestTreeRegexpRecursive
(t *testing.T)
tree_test.go:338
Function
TestURLFormat
(t *testing.T)
middleware/url_format_test.go:11
Function
TestURLFormatInSubRouter
(t *testing.T)
middleware/url_format_test.go:52
Function
TestWalkInlineMiddlewaresAcrossSubrouter
(t *testing.T)
tree_test.go:527
Function
TestWalkMiddlewaresAcrossGroupAndRoute
https://github.com/go-chi/chi/issues/750 Middlewares registered on a Group must still reach handlers defined on a Route() mounted inside that group.
tree_test.go:665
Function
TestWalkRouteWithHandlerAndSubrouter
https://github.com/go-chi/chi/issues/830
tree_test.go:584
Function
TestWalker
(t *testing.T)
tree_test.go:514
Function
TestWrapWriterHTTP2
(t *testing.T)
middleware/middleware_test.go:22
Function
TestXFF_FailClosedOnUnparseable
TestXFF_FailClosedOnUnparseable pins the fail-closed contract for the rightmost-untrusted XFF walk (PR #967 review issue #6, adam-p): if the walker en
middleware/client_ip_test.go:648
Function
TestXFF_IPv6ZoneIDBypassesTrustedV6Prefix
TestXFF_IPv6ZoneIDBypassesTrustedV6Prefix demonstrates the same shape of gap for IPv6 trust prefixes: netip.Prefix.Contains returns false for any zone
middleware/client_ip_test.go:601
Function
TestXFF_MultipleHeadersMerged
"Multiple XFF headers" attack — Go's http.Header.Get returns only the first value, but the security-relevant rightmost IP is in the LAST instance afte
middleware/client_ip_test.go:478
Function
TestXFF_V4MappedIPv6BypassesTrustedV4Prefix
TestXFF_V4MappedIPv6BypassesTrustedV4Prefix demonstrates a gap in the rightmost-untrusted walker: netip.Prefix.Contains returns false when an IPv4-map
middleware/client_ip_test.go:559
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:63
Method
Unwrap
()
middleware/wrap_writer.go:134
Method
Unwrap
()
middleware/compress.go:386
Method
Update
(w http.ResponseWriter, r *http.Request)
_examples/todos-resource/users.go:42
← previous
next →
301–400 of 435, ranked by callers