Documentation ¶
Index ¶
- Variables
- func Bind[T any](c *gin.Context) (*T, error)
- func BindJSON[T any](c *gin.Context) (*T, error)
- func BindJSONValue(c *gin.Context, r interface{}) error
- func BindQuery[T any](c *gin.Context) (*T, error)
- func BindUri[T any](c *gin.Context) (*T, 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 MetaRequest
- type MultipleCreateRequest
- 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 BindJSONValue ¶
func ParseWhere ¶ added in v2.1.9
func ParseWhere(input string) (*clause.ExpressionWhere, error)
Types ¶
type FilterRequest ¶
type FilterRequest struct { OrderBy map[string]string Where *clause.ExpressionWhere }
type MetaRequest ¶
type MetaRequest struct { *PaginationRequest *FilterRequest }
type MultipleCreateRequest ¶ added in v2.1.12
type MultipleCreateRequest[T any] struct { Data []T `json:"data" binding:"required,min=1,max=100"` }
type MultipleDeleteRequest ¶ added in v2.1.12
type MultipleDeleteRequest struct {
Data []int `json:"data" binding:"required,min=1,max=100"`
}
type MultipleUpdateRequest ¶ added in v2.1.12
type MultipleUpdateRequest[T any] struct { Data []T `json:"data" binding:"required,min=1,max=100"` }
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.