Documentation ¶
Index ¶
- Constants
- func Connection(conn string) (_db *gorm.DB)
- func Count(in Modeller, filterArr []Filter, withTrashed bool) (count uint, err error)
- func Create(out interface{}) error
- func DB() *gorm.DB
- func Delete(in interface{}, force bool) error
- func Exist(in Modeller, withTrashed bool) (exist bool)
- func First(out interface{}, withTrashed bool) error
- func Initialize()
- func NewMysql(connection string) *mysql
- func Q(filterArr []Filter, sortArr []Sort, limit int, withTrashed bool) *gorm.DB
- func Restore(in interface{}) error
- func Save(out interface{}, modify interface{}) error
- func SaveByID(id interface{}, out interface{}, modify interface{}) error
- func Transaction(f func(), attempts uint)
- type Filter
- 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(f func(), attempts uint)
Types ¶
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.