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

Method RespHeader

bind.go:256–267  ·  view source on GitHub ↗

RespHeader binds the response header strings into the struct, map[string]string and map[string][]string. Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).

(out any)

Source from the content-addressed store, hash-verified

254// RespHeader binds the response header strings into the struct, map[string]string and map[string][]string.
255// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).
256func (b *Bind) RespHeader(out any) error {
257 bind := binder.GetFromThePool[*binder.RespHeaderBinding](&binder.RespHeaderBinderPool)
258 bind.EnableSplitting = b.ctx.App().config.EnableSplittingOnParsers
259
260 defer releasePooledBinder(&binder.RespHeaderBinderPool, bind)
261
262 if err := b.returnBindErr(bind.Bind(b.ctx.Response(), out), BindSourceRespHeader); err != nil {
263 return err
264 }
265
266 return b.validateStruct(out)
267}
268
269// Cookie binds the request cookie strings into the struct, map[string]string and map[string][]string.
270// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).

Callers 5

Test_Bind_RespHeaderFunction · 0.80
Test_Bind_RespHeader_MapFunction · 0.80
NewFunction · 0.80

Calls 6

returnBindErrMethod · 0.95
validateStructMethod · 0.95
releasePooledBinderFunction · 0.85
AppMethod · 0.65
BindMethod · 0.65
ResponseMethod · 0.65

Tested by 4

Test_Bind_RespHeaderFunction · 0.64
Test_Bind_RespHeader_MapFunction · 0.64