Documentation ¶
Index ¶
- Variables
- func Attach(c *Condition) func(db *gorm.DB) *gorm.DB
- func Paginate(p *Pagination) func(db *gorm.DB) *gorm.DB
- type Attachment
- type Collection
- type Condition
- func (c *Condition) AddJSONQueries(qs ...InnerDetector)
- func (c *Condition) GetAttachmentOrNil(k string) (interface{}, bool)
- func (c *Condition) GetEndTime() uint64
- func (c *Condition) GetJSONQueries() []InnerDetector
- func (c *Condition) GetStartTime() uint64
- func (c *Condition) IsExcludeInactived() bool
- func (c *Condition) SetAttachment(attachment Attachment)
- func (c *Condition) SetExcludeInactived(excludeInactived bool)
- func (c *Condition) SetTimeRange(r Uint64Range)
- type InnerDetector
- func (i *InnerDetector) GetField() string
- func (i *InnerDetector) GetKey1() string
- func (i *InnerDetector) GetKey2() string
- func (i *InnerDetector) GetLevel() int8
- func (i *InnerDetector) GetValue() interface{}
- func (i InnerDetector) SetLevel1(field, key1 string, value interface{}) InnerDetector
- func (i InnerDetector) SetLevel2(field, key1, key2 string, value interface{}) InnerDetector
- type Order
- type Pagination
- func (p *Pagination) BuildCondition() *Condition
- func (p *Pagination) GetAttachment() Attachment
- func (p *Pagination) GetPage() int
- func (p *Pagination) GetPageSize() int
- func (p *Pagination) SetAttachment(a Attachment)
- func (p *Pagination) SetPage(page int)
- func (p *Pagination) SetPageSize(pageSize int)
- type Response
- type Uint64Range
Constants ¶
This section is empty.
Variables ¶
var PaginationColumns = struct { Deleted string TimeRange string }{ Deleted: "excludeInactived", TimeRange: "timeRange", }
PaginationColumns defines all columns var for orm pagination.
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
Values []interface{}
}
Collection wrapper slice condition.
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
Condition builder the model query limit conditions.
func (*Condition) AddJSONQueries ¶
func (c *Condition) AddJSONQueries(qs ...InnerDetector)
AddJSONQueries adder of jsonQueries.
func (*Condition) GetAttachmentOrNil ¶
GetAttachmentOrNil returns (interface{}, bool) pair of key.
func (*Condition) GetJSONQueries ¶
func (c *Condition) GetJSONQueries() []InnerDetector
GetJSONQueries getter of jsonQueries.
func (*Condition) GetStartTime ¶
GetStartTime getter of from.
func (*Condition) IsExcludeInactived ¶
IsExcludeInactived getter of excludeInactived.
func (*Condition) SetAttachment ¶
func (c *Condition) SetAttachment(attachment Attachment)
SetAttachment setter of attachment.
func (*Condition) SetExcludeInactived ¶
SetExcludeInactived setter of excludeInactived.
func (*Condition) SetTimeRange ¶
func (c *Condition) SetTimeRange(r Uint64Range)
SetTimeRange setter includes from, to.
type InnerDetector ¶
type InnerDetector struct {
// contains filtered or unexported fields
}
InnerDetector extension detector for mysql#Json or PSql#Jsonb field type.
func (*InnerDetector) GetField ¶
func (i *InnerDetector) GetField() string
GetField getter of field.
func (*InnerDetector) GetValue ¶
func (i *InnerDetector) GetValue() interface{}
GetValue getter of value.
func (InnerDetector) SetLevel1 ¶
func (i InnerDetector) SetLevel1(field, key1 string, value interface{}) InnerDetector
SetLevel1 setter self to level 1.
func (InnerDetector) SetLevel2 ¶
func (i InnerDetector) SetLevel2(field, key1, key2 string, value interface{}) InnerDetector
SetLevel2 setter self to level 2.
type Pagination ¶
type Pagination struct {
// contains filtered or unexported fields
}
Pagination builder the info of paginate.
func NewPagination ¶
func NewPagination() *Pagination
NewPagination returns default obj of Pagination.
func (*Pagination) BuildCondition ¶
func (p *Pagination) BuildCondition() *Condition
BuildCondition builder func of condition.
func (*Pagination) GetAttachment ¶
func (p *Pagination) GetAttachment() Attachment
GetAttachment getter of attachment.
func (*Pagination) GetPageSize ¶
func (p *Pagination) GetPageSize() int
GetPageSize geeter of pageSize.
func (*Pagination) SetAttachment ¶
func (p *Pagination) SetAttachment(a Attachment)
SetAttachment setter of attachment.
func (*Pagination) SetPageSize ¶
func (p *Pagination) SetPageSize(pageSize int)
SetPageSize setter of pageSize.
type Uint64Range ¶
type Uint64Range struct {
// contains filtered or unexported fields
}
Uint64Range wrapper range condition.
func (Uint64Range) Set ¶
func (r Uint64Range) Set(left, right uint64) Uint64Range
Set setter of left and right.