Home / Function/ HTTPHandlerWithContext() — fiber Function Reference

HTTPHandlerWithContext() — fiber Function Reference

Architecture documentation for the HTTPHandlerWithContext() function in adaptor.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  fa637e33_4848_cefd_22d1_22ad58c2307c["HTTPHandlerWithContext()"]
  69780622_2588_e0fa_ab5a_13dcfd3559e7["adaptor.go"]
  fa637e33_4848_cefd_22d1_22ad58c2307c -->|defined in| 69780622_2588_e0fa_ab5a_13dcfd3559e7
  7830013e_4a82_cad7_8c3c_e338c03f3a5f["LocalContextFromHTTPRequest()"]
  fa637e33_4848_cefd_22d1_22ad58c2307c -->|calls| 7830013e_4a82_cad7_8c3c_e338c03f3a5f
  style fa637e33_4848_cefd_22d1_22ad58c2307c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/adaptor/adaptor.go lines 65–75

func HTTPHandlerWithContext(h http.Handler) fiber.Handler {
	handler := fasthttpadaptor.NewFastHTTPHandler(h)
	return func(c fiber.Ctx) error {
		// Store the Fiber user context (c.Context()) in the fasthttp request context
		// so adapted net/http handlers can retrieve it via adaptor.LocalContextFromHTTPRequest(r)
		c.RequestCtx().SetUserValue(localContextKey, c.Context())

		handler(c.RequestCtx())
		return nil
	}
}

Domain

Subdomains

Frequently Asked Questions

What does HTTPHandlerWithContext() do?
HTTPHandlerWithContext() is a function in the fiber codebase, defined in middleware/adaptor/adaptor.go.
Where is HTTPHandlerWithContext() defined?
HTTPHandlerWithContext() is defined in middleware/adaptor/adaptor.go at line 65.
What does HTTPHandlerWithContext() call?
HTTPHandlerWithContext() calls 1 function(s): LocalContextFromHTTPRequest.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free