https://github.com/dmitrymomot/binder
HTTP request data binder.
https://github.com/dmitrymomot/binder
Last synced: about 2 months ago
JSON representation
HTTP request data binder.
- Host: GitHub
- URL: https://github.com/dmitrymomot/binder
- Owner: dmitrymomot
- License: apache-2.0
- Created: 2023-04-18T07:36:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T07:07:13.000Z (10 months ago)
- Last Synced: 2025-01-31T03:24:43.927Z (4 months ago)
- Language: Go
- Size: 227 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# binder
HTTP request data binder.
[](https://github.com/dmitrymomot/binder)
[](https://github.com/dmitrymomot/binder/actions/workflows/tests.yml)
[](https://github.com/dmitrymomot/binder/actions/workflows/codeql-analysis.yml)
[](https://github.com/dmitrymomot/binder/actions/workflows/golangci-lint.yml)
[](https://goreportcard.com/report/github.com/dmitrymomot/binder)
[](https://pkg.go.dev/github.com/dmitrymomot/binder)
[](https://github.com/dmitrymomot/binder/blob/main/LICENSE)## Features
- [x] Bind query string parameters to struct fields
- [x] Bind form values to struct fields
- [x] Bind JSON body to struct fields
- [x] Get file from multipart form
- [x] Bind multipart form values to struct fields (limited support, see [supported types](#supported-types))
- [x] Binder interface implementation### Supported types
Supported types for binding from multipart form:
- [x] `string`
- [x] `int`, `int8`, `int16`, `int32`, `int64`
- [x] `uint`, `uint8`, `uint16`, `uint32`, `uint64`
- [x] `float32`, `float64`
- [x] `bool`
- [x] `map[string]interface{}`
- [x] `*binder.File` & `binder.File`
- [ ] `time.Time`
- [ ] `[]string`
- [ ] `[]int`, `[]int8`, `[]int16`, `[]int32`, `[]int64`
- [ ] `[]uint`, `[]uint8`, `[]uint16`, `[]uint32`, `[]uint64`
- [ ] `[]float32`, `[]float64`
- [ ] `[]bool`
- [ ] `[]*binder.File` & `[]binder.File`
- [ ] `[]time.Time`## Installation
```bash
go get -u github.com/dmitrymomot/binder
```## Usage
Coming soon...