Bind parses the response header and returns the result.
(resp *fasthttp.Response, out any)
| 17 | |
| 18 | // Bind parses the response header and returns the result. |
| 19 | func (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. |
| 35 | func (b *RespHeaderBinding) Reset() { |