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

Method Bind

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

Bind parses the request cookie and returns the result.

(req *fasthttp.Request, out any)

Source from the content-addressed store, hash-verified

17
18// Bind parses the request cookie and returns the result.
19func (b *CookieBinding) Bind(req *fasthttp.Request, out any) error {
20 data := acquireDataMap()
21 defer releaseDataMap(data)
22
23 for key, val := range req.Header.Cookies() {
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 CookieBinding binder.
35func (b *CookieBinding) Reset() {

Callers 3

Test_CookieBinder_BindFunction · 0.95

Calls 6

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

Tested by 3

Test_CookieBinder_BindFunction · 0.76