MCPcopy Create free account

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

Functions372 in github.com/go-chi/chi

↓ 83 callersMethodGet
(pattern string, h http.HandlerFunc)
chi.go:100
↓ 79 callersMethodWrite
(status, bytes int, header http.Header, elapsed time.Duration, extra interface{})
middleware/logger.go:70
↓ 65 callersMethodHandlerFunc
HandlerFunc builds and returns a http.Handler from the chain of middlewares, with `h http.Handler` as the final handler.
chain.go:18
↓ 58 callersMethodServeHTTP
ServeHTTP is the single method of the http.Handler interface that makes Mux interoperable with the standard library. It uses a sync.Pool to get and re
mux.go:63
↓ 48 callersMethodClose
()
middleware/compress.go:373
↓ 39 callersFunctionNewRouter
NewRouter returns a new Mux object that implements the Router interface.
chi.go:61
↓ 38 callersMethodUse
Use appends one or more middlewares onto the Router stack.
chi.go:72
↓ 28 callersMethodWriteHeader
(code int)
middleware/wrap_writer.go:83
↓ 28 callersFunctiontestRequest
(t *testing.T, ts *httptest.Server, method, path string, body io.Reader)
mux_test.go:1845
↓ 22 callersMethodRoute
Route mounts a sub-Router along a `pattern`` string.
chi.go:82
↓ 22 callersMethodValue
(method methodTyp)
tree.go:128
↓ 15 callersMethodAdd
Add will append a URL parameter to the end of the route param
context.go:148
↓ 13 callersFunctionURLParam
URLParam returns the url parameter from a http.Request object.
context.go:10
↓ 13 callersMethodhandle
handle registers a http.Handler in the routing tree for a particular http method and routing pattern.
mux.go:401
↓ 12 callersMethodNotFound
NotFound defines a handler to respond whenever a route could not be found.
chi.go:110
↓ 11 callersMethodMount
Mount attaches another http.Handler along ./pattern/*
chi.go:85
↓ 11 callersMethodURLParam
URLParam returns the corresponding URL parameter value from the request routing context.
context.go:100
↓ 10 callersFunctionNewRouteContext
NewRouteContext returns a new routing Context object.
context.go:33
↓ 8 callersMethodFindRoute
(rctx *Context, method methodTyp, path string)
tree.go:372
↓ 8 callersMethodInsertRoute
(method methodTyp, pattern string, handler http.Handler)
tree.go:137
↓ 8 callersMethodPost
(pattern string, h http.HandlerFunc)
chi.go:104
↓ 8 callersFunctiontestRequest
(t *testing.T, ts *httptest.Server, method, path string, body io.Reader)
middleware/middleware_test.go:83
↓ 7 callersMethodWith
With adds inline middlewares for an endpoint handler.
chi.go:75
↓ 7 callersFunctionassertEqual
(t *testing.T, a, b interface{})
middleware/middleware_test.go:150
↓ 6 callersMethodPut
(pattern string, h http.HandlerFunc)
chi.go:105
↓ 6 callersMethodRender
(w http.ResponseWriter, r *http.Request)
_examples/rest/main.go:305
↓ 6 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
_examples/custom-handler/main.go:12
↓ 5 callersMethodFlush
()
middleware/compress.go:340
↓ 5 callersMethodHandleFunc
(pattern string, h http.HandlerFunc)
chi.go:90
↓ 5 callersMethodMatch
Match searches the routing tree for a handler that matches the method/path - similar to routing a http request, but without executing the handler ther
chi.go:129
↓ 5 callersFunctionNewArticleResponse
(article *Article)
_examples/rest/main.go:360
↓ 5 callersMethodString
()
middleware/middleware.go:21
↓ 5 callersFunctionassertNoError
(t *testing.T, err error)
middleware/middleware_test.go:136
↓ 5 callersFunctioncW
colorWrite
middleware/terminal.go:55
↓ 5 callersMethodwriter
()
middleware/compress.go:332
↓ 4 callersFunctionChain
Chain returns a Middlewares type from a slice of middleware handlers.
chain.go:6
↓ 4 callersMethodDelete
(pattern string, h http.HandlerFunc)
chi.go:99
↓ 4 callersMethodGroup
Group adds a new inline-Router along the current routing path, with a fresh middleware stack for the inline-Router.
chi.go:79
↓ 4 callersMethodHandle
Handle and HandleFunc adds routes for `pattern` that matches all HTTP methods.
chi.go:89
↓ 4 callersMethodHead
(pattern string, h http.HandlerFunc)
chi.go:101
↓ 4 callersMethodReset
(w io.Writer)
middleware/compress.go:261
↓ 4 callersFunctionRouteContext
RouteContext returns chi's routing Context object from a http.Request Context.
context.go:27
↓ 4 callersMethodStatus
Status returns the HTTP status of the request, or 0 if one has not yet been sent.
middleware/wrap_writer.go:53
↓ 4 callersFunctionThrottleBacklog
ThrottleBacklog is a middleware that limits number of currently processed requests at a time and provides a backlog for holding a finite number of pen
middleware/throttle.go:38
↓ 4 callersFunctionstringSliceEqual
(a, b []string)
tree_test.go:475
↓ 3 callersFunctionErrInvalidRequest
(err error)
_examples/rest/main.go:415
↓ 3 callersMethodMethod
Method adds the route `pattern` that matches `method` http method to execute the `handler` http.Handler.
mux.go:133
↓ 3 callersMethodMethodFunc
(method, pattern string, h http.HandlerFunc)
chi.go:95
↓ 3 callersMethodMethodNotAllowed
MethodNotAllowed defines a handler to respond whenever a method is not allowed.
chi.go:114
↓ 3 callersFunctionNewCompressor
NewCompressor creates a new Compressor that will handle encoding responses. The level should be one of the ones defined in the flate package. The typ
middleware/compress.go:64
↓ 3 callersMethodNotFoundHandler
NotFoundHandler returns the default Mux 404 responder whenever a route cannot be found.
mux.go:383
↓ 3 callersMethodString
()
mux_test.go:1879
↓ 3 callersFunctionchain
chain builds a http.Handler composed of an inline middleware stack and endpoint handler in the order they are passed.
chain.go:36
↓ 3 callersFunctionpatNextSegment
patNextSegment returns the next segment details from a pattern: node type, param key, regexp string, param tail byte, param starting index, param endi
tree.go:689
↓ 2 callersMethodBind
Bind on UserPayload will run after the unmarshalling is complete, its a good time to focus some post-processing after a decoding.
_examples/rest/main.go:301
↓ 2 callersMethodBytesWritten
()
middleware/wrap_writer.go:123
↓ 2 callersFunctionErrRender
(err error)
_examples/rest/main.go:424
↓ 2 callersFunctionGetReqID
GetReqID returns a request ID from the given context if one is present. Returns the empty string if a request ID cannot be found.
middleware/request_id.go:83
↓ 2 callersMethodHandler
Handler builds and returns a http.Handler from the chain of middlewares, with `h http.Handler` as the final handler.
chain.go:12
↓ 2 callersMethodHijack
()
middleware/wrap_writer.go:157
↓ 2 callersMethodMethod
Method and MethodFunc adds routes for `pattern` that matches the `method` HTTP method.
chi.go:94
↓ 2 callersMethodMount
Mount attaches another http.Handler or chi Router as a subrouter along a routing path. It's very useful to split up a large API as many independent ro
mux.go:295
↓ 2 callersFunctionNewArticleListResponse
(articles []*Article)
_examples/rest/main.go:378
↓ 2 callersFunctionNewArticleResponse
(article *data.Article)
_examples/versions/presenter/v2/article.go:28
↓ 2 callersFunctionNewArticleResponse
(article *data.Article)
_examples/versions/presenter/v3/article.go:37
↓ 2 callersFunctionNewArticleResponse
(article *data.Article)
_examples/versions/presenter/v1/article.go:20
↓ 2 callersFunctionNewPattern
(value string)
middleware/route_headers.go:134
↓ 2 callersFunctionNewWrapResponseWriter
NewWrapResponseWriter wraps an http.ResponseWriter, returning a proxy that allows you to hook into various parts of the response process.
middleware/wrap_writer.go:16
↓ 2 callersFunctionPrintPrettyStack
(rvr interface{})
middleware/recoverer.go:54
↓ 2 callersMethodRoutePattern
RoutePattern builds the routing pattern string for the particular request, at the particular point during routing. This means, the value will change t
context.go:123
↓ 2 callersMethodRoutes
Routes returns the routing tree in an easily traversable structure.
chi.go:121
↓ 2 callersMethodSetEncoder
SetEncoder can be used to set the implementation of a compression algorithm. The encoding should be a standardised identifier. See: https://developer
middleware/compress.go:148
↓ 2 callersMethodTee
(w io.Writer)
middleware/wrap_writer.go:127
↓ 2 callersFunctionThrottleWithOpts
ThrottleWithOpts is a middleware that limits number of currently processed requests using passed ThrottleOpts.
middleware/throttle.go:43
↓ 2 callersMethodWrite
(buf []byte)
middleware/wrap_writer.go:93
↓ 2 callersFunctionbigMux
()
mux_test.go:948
↓ 2 callersFunctioncontentEncoding
Check the content encoding against a list of acceptable values.
middleware/content_charset.go:28
↓ 2 callersMethodfindEdge
(ntyp nodeTyp, label byte)
tree.go:546
↓ 2 callersMethodfindPattern
(pattern string)
tree.go:578
↓ 2 callersMethodisLeaf
()
tree.go:574
↓ 2 callersFunctionlongestPrefix
longestPrefix finds the length of the shared prefix of two strings
tree.go:779
↓ 2 callersMethodmaybeWriteHeader
()
middleware/wrap_writer.go:113
↓ 2 callersMethodnextRoutePath
(rctx *Context)
mux.go:469
↓ 2 callersMethodroutes
()
tree.go:620
↓ 2 callersFunctionsplit
Split a string in two parts, cleaning any whitespace.
middleware/content_charset.go:42
↓ 2 callersMethodupdateRouteHandler
updateRouteHandler builds the single mux handler that is a chain of the middleware stack, as defined by calls to Use(), and the tree router (Mux) itse
mux.go:493
↓ 2 callersMethodupdateSubRoutes
Recursively update data on child routers.
mux.go:479
↓ 1 callersFunctionAllowContentEncoding
AllowContentEncoding enforces a whitelist of request Content-Encoding otherwise responds with a 415 Unsupported Media Type status.
middleware/content_encoding.go:10
↓ 1 callersFunctionAllowContentType
AllowContentType enforces a whitelist of request Content-Types otherwise responds with a 415 Unsupported Media Type status.
middleware/content_type.go:21
↓ 1 callersMethodBytesWritten
BytesWritten returns the total number of bytes sent to the client.
middleware/wrap_writer.go:55
↓ 1 callersFunctionContentCharset
ContentCharset generates a handler that writes a 415 Unsupported Media Type response if none of the charsets match. An empty charset will allow reques
middleware/content_charset.go:10
↓ 1 callersMethodDiscard
()
middleware/wrap_writer.go:135
↓ 1 callersFunctionFileServer
FileServer conveniently sets up a http.FileServer handler to serve static files from a http.FileSystem.
_examples/fileserver/main.go:48
↓ 1 callersMethodFlush
()
middleware/wrap_writer.go:191
↓ 1 callersMethodFlush
()
middleware/wrap_writer.go:232
↓ 1 callersMethodGet
Get adds the route `pattern` that matches a GET http method to execute the `handlerFn` http.HandlerFunc.
mux.go:161
↓ 1 callersFunctionGetLogEntry
GetLogEntry returns the in-context LogEntry for a request.
middleware/logger.go:75
↓ 1 callersMethodGroup
Group creates a new inline-Mux with a copy of middleware stack. It's useful for a group of handlers along the same routing path that use an additional
mux.go:268
↓ 1 callersMethodHandler
Handler returns a new middleware that will compress the response based on the current Compressor.
middleware/compress.go:190
↓ 1 callersMethodIsMatch
(value string)
middleware/route_headers.go:115
next →1–100 of 372, ranked by callers