mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-01 13:16:18 +00:00
* 🐛 bug: fix EnableSplittingOnParsers is not functional
* remove wrong testcase
* add support for external xml decoders
* improve test coverage
* fix linter
* update
* add reset methods
* improve test coverage
* merge Form and MultipartForm methods
* fix linter
* split reset and putting steps
* fix linter
26 lines
518 B
Go
26 lines
518 B
Go
package binder
|
|
|
|
import (
|
|
"github.com/gofiber/utils/v2"
|
|
)
|
|
|
|
// CBORBinding is the CBOR binder for CBOR request body.
|
|
type CBORBinding struct {
|
|
CBORDecoder utils.CBORUnmarshal
|
|
}
|
|
|
|
// Name returns the binding name.
|
|
func (*CBORBinding) Name() string {
|
|
return "cbor"
|
|
}
|
|
|
|
// Bind parses the request body as CBOR and returns the result.
|
|
func (b *CBORBinding) Bind(body []byte, out any) error {
|
|
return b.CBORDecoder(body, out)
|
|
}
|
|
|
|
// Reset resets the CBORBinding binder.
|
|
func (b *CBORBinding) Reset() {
|
|
b.CBORDecoder = nil
|
|
}
|