Documentation ¶
Index ¶
- Constants
- func Connection(conn string) (_db *gorm.DB)
- func DB() *gorm.DB
- func Initialize()
- func NewMysql(connection string) *mysql
- func Prefix() string
- func Transaction(tf transactionFunc, attempts uint)
- type BaseModel
- type BaseModeller
- type Filter
- type Helper
- func (h *Helper) Count(in Modeller, filterArr []Filter, withTrashed bool) (count uint, err error)
- func (h *Helper) Create(out interface{}) error
- func (h *Helper) Delete(in interface{}, force bool) error
- func (h *Helper) Exist(in Modeller, withTrashed bool) (exist bool)
- func (h *Helper) First(out interface{}, withTrashed bool) error
- func (h *Helper) Q(filterArr []Filter, sortArr []Sort, limit int, withTrashed bool) *gorm.DB
- func (h *Helper) Restore(in interface{}) error
- func (h *Helper) Save(out interface{}, modify interface{}) error
- func (h *Helper) SaveByID(id interface{}, out interface{}, modify interface{}) error
- type Model
- type Modeller
- type OrmConfigurator
- 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 ¶
func Connection ¶
func Initialize ¶
func Initialize()
func Transaction ¶
func Transaction(tf transactionFunc, attempts uint)
Types ¶
type BaseModel ¶ added in v0.2.0
type BaseModel struct {
// contains filtered or unexported fields
}
type BaseModeller ¶ added in v0.2.0
type Helper ¶ added in v0.2.0
type Helper struct {
BaseModel
}
var H Helper
type Modeller ¶
type Modeller interface { BaseModeller Default() interface{} ObjArr(filterArr []Filter, sortArr []Sort, limit int, withTrashed bool) (interface{}, error) ObjArrPaginate(c *gin.Context, perPage uint, filterArr []Filter, sortArr []Sort, limit int, withTrashed bool) (pagination Pagination, err error) }
type OrmConfigurator ¶
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.