MCPcopy Create free account

hub / github.com/go-chi/chi / functions

Functions435 in github.com/go-chi/chi

MethodUpdate
(w http.ResponseWriter, r *http.Request)
_examples/todos-resource/todos.go:43
FunctionUpdateArticle
UpdateArticle updates an existing Article in our persistent store.
_examples/rest/main.go:186
FunctionWithValue
WithValue is a middleware that sets a given key/value in a context chain.
middleware/value.go:9
MethodWrite
(status, bytes int, header http.Header, elapsed time.Duration, extra interface{})
middleware/logger.go:140
MethodWrite
(p []byte)
middleware/compress.go:330
FunctioncustomHandler
(w http.ResponseWriter, r *http.Request)
_examples/custom-handler/main.go:26
FunctiondebugPrintTree
(parent int, i int, n *node, label byte)
tree_test.go:449
FunctionencoderDeflate
(w io.Writer, level int)
middleware/compress.go:398
FunctionencoderGzip
(w io.Writer, level int)
middleware/compress.go:390
MethodfindEdge
(label byte)
tree.go:850
FunctiongetArticle
(w http.ResponseWriter, r *http.Request)
_examples/versions/main.go:103
Functioninit
()
_examples/custom-method/main.go:10
Functioninit
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
Functioninit
()
middleware/middleware_test.go:17
Functioninit
()
middleware/logger.go:172
Functioninit
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
Functioninit
()
middleware/terminal.go:37
FunctionlistArticles
(w http.ResponseWriter, r *http.Request)
_examples/versions/main.go:71
Functionmain
()
_examples/pathvalue/main.go:10
Functionmain
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
Functionmain
()
_examples/limits/main.go:21
Functionmain
()
_examples/custom-method/main.go:16
Functionmain
()
_examples/versions/main.go:22
Functionmain
()
_examples/custom-handler/main.go:20
Functionmain
()
_examples/todos-resource/main.go:14
Functionmain
()
_examples/rest/main.go:55
Functionmain
()
_examples/router-walk/main.go:11
Functionmain
()
_examples/fileserver/main.go:28
Functionmain
()
_examples/graceful/main.go:17
Functionmain
()
_examples/hello-world/main.go:10
Functionpaginate
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
FunctionpanickingHandler
(http.ResponseWriter, *http.Request)
middleware/recoverer_test.go:13
FunctionpathValueHandler
pathValueHandler retrieves a URL parameter using PathValue and writes it to the response.
_examples/pathvalue/main.go:20
FunctionrandomErrorMiddleware
(next http.Handler)
_examples/versions/main.go:142
MethodrouteHTTP
routeHTTP routes a http.Request through the Mux routing tree to serve the matching handler for a particular http method.
mux.go:447
← previous401–435 of 435, ranked by callers