mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-01 05:01:48 +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
25 lines
622 B
Go
25 lines
622 B
Go
package binder
|
|
|
|
// uriBinding is the URI binder for URI parameters.
|
|
type URIBinding struct{}
|
|
|
|
// Name returns the binding name.
|
|
func (*URIBinding) Name() string {
|
|
return "uri"
|
|
}
|
|
|
|
// Bind parses the URI parameters and returns the result.
|
|
func (b *URIBinding) Bind(params []string, paramsFunc func(key string, defaultValue ...string) string, out any) error {
|
|
data := make(map[string][]string, len(params))
|
|
for _, param := range params {
|
|
data[param] = append(data[param], paramsFunc(param))
|
|
}
|
|
|
|
return parse(b.Name(), out, data)
|
|
}
|
|
|
|
// Reset resets URIBinding binder.
|
|
func (*URIBinding) Reset() {
|
|
// Nothing to reset
|
|
}
|