Documentation
¶
Overview ¶
*FileHeader
- @Author: Liangkang Zhang
- @Date: 2026/1/26 23:42:17
- @LastEditors: Liangkang Zhang
- @LastEditTime: 2026/1/26 23:42:25
- @Description:
- @Copyright: Copyright (©)}) 2026 Liangkang Zhang<lkzhang98@gmail.com>. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.. All rights reserved.
- @Email: lkzhang98@gmail.com
- @Repository: https://github.com/geminik12/autostack
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶
func Bind(c *gin.Context, obj interface{}, bindFuncs ...func(*gin.Context, interface{}) error) error
Bind processes data from multiple sources without validating between each step, then performs a single validation at the end.
This solves the problem where binding from one source (e.g., URI) fails validation because fields from another source (e.g., JSON) haven't been bound yet.
Example usage:
var req UserUpdateRequest
if err := binding.Bind(c, &req, binding.URI, binding.JSON); err != nil {
c.JSON(http.StatusBadRequest, ErrorResponse{Message: err.Error()})
return
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.