mirror of
https://github.com/iLoveElysia/openbilibili.git
synced 2026-03-14 05:46:26 -05:00
20 lines
306 B
Go
20 lines
306 B
Go
package binding
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type queryBinding struct{}
|
|
|
|
func (queryBinding) Name() string {
|
|
return "query"
|
|
}
|
|
|
|
func (queryBinding) Bind(req *http.Request, obj interface{}) error {
|
|
values := req.URL.Query()
|
|
if err := mapForm(obj, values); err != nil {
|
|
return err
|
|
}
|
|
return validate(obj)
|
|
}
|