Documentation ¶
Index ¶
- Constants
- type BaseModel
- func (bm *BaseModel) AfterFind(scope *gorm.Scope) (err error)
- func (bm *BaseModel) BeforeSave(scope *gorm.Scope) (err error)
- func (bm *BaseModel) BeforeUpdate(scope *gorm.Scope) (err error)
- func (bm *BaseModel) DB() *gorm.DB
- func (bm *BaseModel) SetDB(db *gorm.DB)
- func (bm *BaseModel) SetTX(db *gorm.DB)
- func (bm *BaseModel) SetTableName(tableName string) string
- type BaseModeller
- type Context
- type Filter
- type Model
- type Modeller
- type Pagination
- func (p *Pagination) Count() uint
- func (p *Pagination) CurrentPage() uint
- func (p *Pagination) FirstItem() interface{}
- func (p *Pagination) ItemArr() interface{}
- func (p *Pagination) LastItem() interface{}
- func (p *Pagination) LastPage() uint
- func (p *Pagination) PerPage() uint
- func (p *Pagination) Total() uint
- type Sort
Constants ¶
View Source
const ( ASC sortDirection = iota DESC )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseModel ¶ added in v0.2.0
type BaseModel struct {
// contains filtered or unexported fields
}
func (*BaseModel) AfterFind ¶ added in v0.10.0
func (bm *BaseModel) AfterUpdate() error {
} func (bm *BaseModel) AfterSave() error {
}
func (*BaseModel) BeforeSave ¶ added in v0.10.0
func (*BaseModel) BeforeUpdate ¶ added in v0.10.0
func (*BaseModel) SetTableName ¶ added in v0.3.2
type BaseModeller ¶ added in v0.2.0
type Context ¶ added in v0.9.0
type Context interface { context.RequestParamContextor }
type Modeller ¶
type Modeller interface { BaseModeller TableName() string Default() interface{} ObjArr(filterArr []Filter, sortArr []Sort, limit int, withTrashed bool) (interface{}, error) ObjArrPaginate(c Context, perPage uint, filterArr []Filter, sortArr []Sort, limit int, withTrashed bool) (pagination Pagination, err error) }
type Pagination ¶
type Pagination struct {
// contains filtered or unexported fields
}
func (*Pagination) Count ¶
func (p *Pagination) Count() uint
func (*Pagination) CurrentPage ¶
func (p *Pagination) CurrentPage() uint
func (*Pagination) FirstItem ¶
func (p *Pagination) FirstItem() interface{}
func (*Pagination) ItemArr ¶
func (p *Pagination) ItemArr() interface{}
func (*Pagination) LastItem ¶
func (p *Pagination) LastItem() interface{}
func (*Pagination) LastPage ¶
func (p *Pagination) LastPage() uint
func (*Pagination) PerPage ¶
func (p *Pagination) PerPage() uint
func (*Pagination) Total ¶
func (p *Pagination) Total() uint
Click to show internal directories.
Click to hide internal directories.