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

Method Bind

binder/resp_header.go:19–32  ·  view source on GitHub ↗

Bind parses the response header and returns the result.

(resp *fasthttp.Response, out any)

Source from the content-addressed store, hash-verified

17
18// Bind parses the response header and returns the result.
19func (b *RespHeaderBinding) Bind(resp *fasthttp.Response, out any) error {
20 data := acquireDataMap()
21 defer releaseDataMap(data)
22
23 for key, val := range resp.Header.All() {
24 k := utils.UnsafeString(key)
25 v := utils.UnsafeString(val)
26 if err := formatBindData(b.Name(), out, data, k, v, b.EnableSplitting, false); err != nil {
27 return err
28 }
29 }
30
31 return parse(b.Name(), out, data)
32}
33
34// Reset resets the RespHeaderBinding binder.
35func (b *RespHeaderBinding) Reset() {

Calls 6

NameMethod · 0.95
acquireDataMapFunction · 0.85
releaseDataMapFunction · 0.85
formatBindDataFunction · 0.85
parseFunction · 0.85
AllMethod · 0.65