Home / Function/ newClient() — fiber Function Reference

newClient() — fiber Function Reference

Architecture documentation for the newClient() function in client.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  24aaca32_eb66_be05_70a5_8cf3aba6bf93["newClient()"]
  0a898b85_5e70_235c_a863_b41e3d48af64["client.go"]
  24aaca32_eb66_be05_70a5_8cf3aba6bf93 -->|defined in| 0a898b85_5e70_235c_a863_b41e3d48af64
  fa965401_cda1_cdbc_c318_9f4ba0971180["NewWithClient()"]
  fa965401_cda1_cdbc_c318_9f4ba0971180 -->|calls| 24aaca32_eb66_be05_70a5_8cf3aba6bf93
  90b226fd_ec54_5025_eadf_2858c6d694ae["NewWithHostClient()"]
  90b226fd_ec54_5025_eadf_2858c6d694ae -->|calls| 24aaca32_eb66_be05_70a5_8cf3aba6bf93
  42fee616_6735_1e43_e5e0_d02aad9f0e5a["NewWithLBClient()"]
  42fee616_6735_1e43_e5e0_d02aad9f0e5a -->|calls| 24aaca32_eb66_be05_70a5_8cf3aba6bf93
  style 24aaca32_eb66_be05_70a5_8cf3aba6bf93 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

client/client.go lines 783–807

func newClient(transport httpClientTransport) *Client {
	return &Client{
		transport: transport,
		header: &Header{
			RequestHeader: &fasthttp.RequestHeader{},
		},
		params: &QueryParam{
			Args: fasthttp.AcquireArgs(),
		},
		cookies: &Cookie{},
		path:    &PathParam{},

		userRequestHooks:     []RequestHook{},
		builtinRequestHooks:  []RequestHook{parserRequestURL, parserRequestHeader, parserRequestBody},
		userResponseHooks:    []ResponseHook{},
		builtinResponseHooks: []ResponseHook{parserResponseCookie, logger},
		jsonMarshal:          json.Marshal,
		jsonUnmarshal:        json.Unmarshal,
		xmlMarshal:           xml.Marshal,
		cborMarshal:          cbor.Marshal,
		cborUnmarshal:        cbor.Unmarshal,
		xmlUnmarshal:         xml.Unmarshal,
		logger:               log.DefaultLogger[*log.Logger](),
	}
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does newClient() do?
newClient() is a function in the fiber codebase, defined in client/client.go.
Where is newClient() defined?
newClient() is defined in client/client.go at line 783.
What calls newClient()?
newClient() is called by 3 function(s): NewWithClient, NewWithHostClient, NewWithLBClient.

Analyze Your Own Codebase

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

Try Supermodel Free