Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Eq equal Eq = "eq" // Neq not equal Neq = "neq" // Gt greater than Gt = "gt" // Gte greater than or equal Gte = "gte" // Lt less than Lt = "lt" // Lte less than or equal Lte = "lte" // Like like Like = "like" // AND logic and AND string = "and" // OR logic or OR string = "or" )
Variables ¶
View Source
var ( // ErrNotFound record ErrNotFound = gorm.ErrRecordNotFound )
Functions ¶
func SetMaxSize ¶
func SetMaxSize(max int)
SetMaxSize change the default maximum number of pages per page
Types ¶
type Column ¶
type Column struct { Name string `json:"name"` // column name Exp string `json:"exp"` // expressions, which default to = when the value is null, have =, ! =, >, >=, <, <=, like Value interface{} `json:"value"` // column value Logic string `json:"logic"` // logical type, defaults to and when the value is null, with &(and), ||(or) }
Column search information
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
Page info
func DefaultPage ¶
DefaultPage default page, number 20 per page, sorted by id backwards
type Params ¶
type Params struct { Page int `form:"page" binding:"gte=0" json:"page"` Size int `form:"size" binding:"gt=0" json:"size"` Sort string `form:"sort" binding:"" json:"sort,omitempty"` Columns []Column `json:"columns,omitempty"` // not required }
Params query parameters
func (*Params) ConvertToGormConditions ¶
ConvertToGormConditions conversion to gorm-compliant parameters based on the Columns parameter ignore the logical type of the last column, whether it is a one-column or multi-column query
Click to show internal directories.
Click to hide internal directories.