MCPcopy
hub / github.com/gin-gonic/gin / ServeHTTP

Method ServeHTTP

gin.go:662–675  ·  view source on GitHub ↗

ServeHTTP conforms to the http.Handler interface.

(w http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

660
661// ServeHTTP conforms to the http.Handler interface.
662func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) {
663 engine.routeTreesUpdated.Do(func() {
664 engine.updateRouteTrees()
665 })
666
667 c := engine.pool.Get().(*Context)
668 c.writermem.reset(w)
669 c.Request = req
670 c.reset()
671
672 engine.handleHTTPRequest(c)
673
674 engine.pool.Put(c)
675}
676
677// HandleContext re-enters a context that has been rewritten.
678// This can be done by setting c.Request.URL.Path to your new target.

Callers 15

WrapHFunction · 0.45
BenchmarkParallelGithubFunction · 0.45
TestBasicAuthSucceedFunction · 0.45
TestBasicAuth401Function · 0.45
TestBasicAuthForProxy407Function · 0.45
PerformRequestFunction · 0.45
runRequestFunction · 0.45

Calls 4

updateRouteTreesMethod · 0.95
handleHTTPRequestMethod · 0.95
GetMethod · 0.45
resetMethod · 0.45