Home / Function/ adaptHTTPHandler() — fiber Function Reference

adaptHTTPHandler() — fiber Function Reference

Architecture documentation for the adaptHTTPHandler() function in adapter.go from the fiber codebase.

Function go FiberCore Context calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  912f9d32_0233_1ada_04dd_b642002f551d["adaptHTTPHandler()"]
  be85d8ad_2478_47b5_e5e7_f666d58bdb3a["adapter.go"]
  912f9d32_0233_1ada_04dd_b642002f551d -->|defined in| be85d8ad_2478_47b5_e5e7_f666d58bdb3a
  694b7407_0512_b0f6_166f_f7fd153ca0dd["toFiberHandler()"]
  694b7407_0512_b0f6_166f_f7fd153ca0dd -->|calls| 912f9d32_0233_1ada_04dd_b642002f551d
  27fea6d5_da47_c906_97fe_b64ef9825011["wrapHTTPHandler()"]
  912f9d32_0233_1ada_04dd_b642002f551d -->|calls| 27fea6d5_da47_c906_97fe_b64ef9825011
  2c84ce49_cad5_0a11_3692_2c7cc1960a4d["isNilableKind()"]
  912f9d32_0233_1ada_04dd_b642002f551d -->|calls| 2c84ce49_cad5_0a11_3692_2c7cc1960a4d
  style 912f9d32_0233_1ada_04dd_b642002f551d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

adapter.go lines 188–212

func adaptHTTPHandler(handler any) (Handler, bool) {
	switch h := handler.(type) {
	case http.HandlerFunc: // (13) net/http HandlerFunc
		if h == nil {
			return nil, false
		}
		return wrapHTTPHandler(h), true
	case http.Handler: // (14) net/http Handler implementation
		if h == nil {
			return nil, false
		}
		hv := reflect.ValueOf(h)
		if isNilableKind(hv.Kind()) && hv.IsNil() {
			return nil, false
		}
		return wrapHTTPHandler(h), true
	case func(http.ResponseWriter, *http.Request): // (15) net/http function handler
		if h == nil {
			return nil, false
		}
		return wrapHTTPHandler(http.HandlerFunc(h)), true
	default:
		return nil, false
	}
}

Domain

Subdomains

Defined In

Called By

Frequently Asked Questions

What does adaptHTTPHandler() do?
adaptHTTPHandler() is a function in the fiber codebase, defined in adapter.go.
Where is adaptHTTPHandler() defined?
adaptHTTPHandler() is defined in adapter.go at line 188.
What does adaptHTTPHandler() call?
adaptHTTPHandler() calls 2 function(s): isNilableKind, wrapHTTPHandler.
What calls adaptHTTPHandler()?
adaptHTTPHandler() is called by 1 function(s): toFiberHandler.

Analyze Your Own Codebase

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

Try Supermodel Free