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

Method MsgPack

bind.go:378–389  ·  view source on GitHub ↗

MsgPack binds the body string into the struct. 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

376// MsgPack binds the body string into the struct.
377// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).
378func (b *Bind) MsgPack(out any) error {
379 bind := binder.GetFromThePool[*binder.MsgPackBinding](&binder.MsgPackBinderPool)
380 bind.MsgPackDecoder = b.ctx.App().Config().MsgPackDecoder
381
382 defer releasePooledBinder(&binder.MsgPackBinderPool, bind)
383
384 if err := b.returnBindErr(bind.Bind(b.ctx.Body(), out), BindSourceBody); err != nil {
385 return err
386 }
387
388 return b.validateStruct(out)
389}
390
391// Body binds the request body into the struct, map[string]string and map[string][]string.
392// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).

Callers 1

BodyMethod · 0.95

Calls 7

returnBindErrMethod · 0.95
validateStructMethod · 0.95
releasePooledBinderFunction · 0.85
ConfigMethod · 0.65
AppMethod · 0.65
BindMethod · 0.65
BodyMethod · 0.65

Tested by

no test coverage detected