Documentation ¶
Index ¶
- Variables
- func Bind[T any](c *gin.Context) (*T, error)
- func BindImportFileRequest[T any](c *gin.Context) ([]T, map[string]string, error)
- func BindJSON[T any](c *gin.Context) (*T, error)
- func BindJSONValue(c *gin.Context, r interface{}) error
- func BindJsonStruct(obj any) error
- func BindQuery[T any](c *gin.Context) (*T, error)
- func BindUri[T any](c *gin.Context) (*T, error)
- func DecodeJSON(r io.Reader, obj any) error
- func Id(c *gin.Context) (int, error)
- func ParseWhere(input string) (*clause.ExpressionWhere, error)
- func TxHandle(c *gin.Context) *gorm.DB
- func UUID(c *gin.Context) (string, error)
- type FilterRequest
- type IdRequest
- type ImportRequest
- type MetaRequest
- type MultipleDeleteRequest
- type MultipleUpdateRequest
- type PaginationRequest
- type UUIDRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorValidationId = apperr.New("validation_id", apperr.WithTextTranslate(i18n.ErrorValidationId), apperr.WithCode(code.InvalidArgument)) ErrorValidationUUID = apperr.New("validation_uuid", apperr.WithTextTranslate(i18n.ErrorValidationUUID), apperr.WithCode(code.InvalidArgument)) )
Functions ¶
func BindImportFileRequest ¶ added in v2.3.0
func BindJSONValue ¶
func BindJsonStruct ¶ added in v2.3.0
func ParseWhere ¶ added in v2.1.9
func ParseWhere(input string) (*clause.ExpressionWhere, error)
Types ¶
type FilterRequest ¶
type FilterRequest struct { OrderBy []clause.ExpressionOrderBy Where *clause.ExpressionWhere }
func FilterJSON ¶ added in v2.3.0
func FilterJSON(c *gin.Context) (*FilterRequest, error)
type ImportRequest ¶ added in v2.3.0
type ImportRequest struct {
CSV *multipart.FileHeader `form:"csv" binding:"required"`
}
type MetaRequest ¶
type MetaRequest struct { *PaginationRequest *FilterRequest }
type MultipleDeleteRequest ¶ added in v2.1.12
type MultipleDeleteRequest struct {
IDs []int `json:"ids" binding:"required,min=1,max=500000,unique"`
}
type MultipleUpdateRequest ¶ added in v2.1.12
type PaginationRequest ¶
type PaginationRequest struct { Limit int `form:"limit" binding:"omitempty"` Offset int `form:"offset" binding:"omitempty"` MustReturnTotalRows bool `form:"count" binding:"omitempty"` }
func Pagination ¶
func Pagination(c *gin.Context) (*PaginationRequest, error)
type UUIDRequest ¶
type UUIDRequest struct {
UUID string `uri:"uuid" binding:"required"`
}
Click to show internal directories.
Click to hide internal directories.