MCPcopy
hub / github.com/gofiber/fiber / New

Function New

client/client.go:926–931  ·  view source on GitHub ↗

New creates and returns a new Client object.

()

Source from the content-addressed store, hash-verified

924
925// New creates and returns a new Client object.
926func New() *Client {
927 // Follow-up performance optimizations:
928 // Try to use a pool to reduce the memory allocation cost for the Fiber client and the fasthttp client.
929 // If possible, also consider pooling other structs (e.g., request headers, cookies, query parameters, path parameters).
930 return NewWithClient(&fasthttp.Client{})
931}
932
933// NewWithClient creates and returns a new Client object from an existing fasthttp.Client.
934func NewWithClient(c *fasthttp.Client) *Client {

Callers 15

Test_Parser_Request_URLFunction · 0.70
Test_Parser_Request_BodyFunction · 0.70
Test_Client_Logger_DebugFunction · 0.70
Test_Response_StatusFunction · 0.70
Test_Response_ProtocolFunction · 0.70
Test_Response_HeaderFunction · 0.70
Test_Response_HeadersFunction · 0.70
Benchmark_HeadersFunction · 0.70
Test_Response_CookieFunction · 0.70

Calls 1

NewWithClientFunction · 0.85

Tested by 15

Test_Parser_Request_URLFunction · 0.56
Test_Parser_Request_BodyFunction · 0.56
Test_Client_Logger_DebugFunction · 0.56
Test_Response_StatusFunction · 0.56
Test_Response_ProtocolFunction · 0.56
Test_Response_HeaderFunction · 0.56
Test_Response_HeadersFunction · 0.56
Benchmark_HeadersFunction · 0.56
Test_Response_CookieFunction · 0.56