github.com/hellobchain/third_party@v0.0.0-20230331131523-deb0478a2e52/gin/binding/query.go (about) 1 // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 // Use of this source code is governed by a MIT style 3 // license that can be found in the LICENSE file. 4 5 package binding 6 7 import "github.com/hellobchain/newcryptosm/http" 8 9 type queryBinding struct{} 10 11 func (queryBinding) Name() string { 12 return "query" 13 } 14 15 func (queryBinding) Bind(req *http.Request, obj interface{}) error { 16 values := req.URL.Query() 17 if err := mapForm(obj, values); err != nil { 18 return err 19 } 20 return validate(obj) 21 }