We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func (b *Binding) bindStruct(structPointer interface{}, structValue reflect.Value, req Request, pathParams PathParams) (hasVd bool, err error) { recv, err := b.getOrPrepareReceiver(structValue) if err != nil { return }
expr, err := b.vd.VM().Run(structValue) if err != nil { return } bodyCodec, bodyBytes, err := recv.getBodyInfo(req) if len(bodyBytes) > 0 { err = b.prebindBody(structPointer, structValue, bodyCodec, bodyBytes) } if err != nil { return } bodyString := ameda.UnsafeBytesToString(bodyBytes) postForm, err := req.GetPostForm() if err != nil { return } var fileHeaders map[string][]*multipart.FileHeader if _req, ok := req.(requestWithFileHeader); ok { fileHeaders, err = _req.GetFileHeaders() if err != nil { return } } queryValues := recv.getQuery(req) cookies := recv.getCookies(req) headers := req.GetHeader() for _, param := range recv.params { for i, info := range param.tagInfos { var found bool switch info.paramIn { case raw_body: err = param.bindRawBody(info, expr, bodyBytes) found = err == nil case path: found, err = param.bindPath(info, expr, pathParams) case query: found, err = param.bindQuery(info, expr, queryValues) case cookie: found, err = param.bindCookie(info, expr, cookies) case header: found, err = param.bindHeader(info, expr, headers) case form, json, protobuf: if info.paramIn == in(bodyCodec) { found, err = param.bindOrRequireBody(info, expr, bodyCodec, bodyString, postForm, fileHeaders, recv.hasDefaultVal) } else if info.required { found = false err = info.requiredError } case default_val: found, err = param.bindDefaultVal(expr, param.defaultVal) } if found && err == nil { break } if (found || i == len(param.tagInfos)-1) && err != nil { return recv.hasVd, err } } } return recv.hasVd, nil
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
func (b *Binding) bindStruct(structPointer interface{}, structValue reflect.Value, req Request, pathParams PathParams) (hasVd bool, err error) {
recv, err := b.getOrPrepareReceiver(structValue)
if err != nil {
return
}
}
The text was updated successfully, but these errors were encountered: