1 Star 0 Fork 3

Fengzhi/gkit

forked from menuiis/gkit 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
all.go 591 Bytes
一键复制 编辑 原始数据 按行查看 历史
menuis 提交于 2024-04-22 10:18 +08:00 . init
package bind
import (
"net/http"
"gitee.com/menciis/gkit/options"
)
type all struct {
contentType string
selectorParse []Binding
}
func (*all) Name() string {
return "all"
}
func (a *all) Bind(req *http.Request, obj interface{}) error {
for _, binding := range a.selectorParse {
if err := binding.Bind(req, obj); err != nil {
return err
}
}
return validate(obj)
}
func CreateBindAll(contentType string, option ...options.Option) Binding {
a := &all{contentType: contentType, selectorParse: DefaultParse(contentType)}
for _, o := range option {
o(a)
}
return a
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fengzhi_1/gkit.git
git@gitee.com:fengzhi_1/gkit.git
fengzhi_1
gkit
gkit
b6285053065d

搜索帮助