Documentation ¶
Index ¶
- func RegDB(dbi *gorm.DB)
- func SetConfig(cfg Config)
- type Config
- type Registrar
- func (r *Registrar) BatchCRUPDHooks(before func(bhpData models.BatchHookPointData, op models.CRUPDOp) error, ...) *Registrar
- func (r *Registrar) BatchCreateHooks(before func(bhpData models.BatchHookPointData) error, ...) *Registrar
- func (r *Registrar) BatchDeleteHooks(before func(bhpData models.BatchHookPointData) error, ...) *Registrar
- func (r *Registrar) BatchPatchHooks(beforeApply func(bhpData models.BatchHookPointData) error, ...) *Registrar
- func (r *Registrar) BatchReadHooks(after func(bhpData models.BatchHookPointData) error) *Registrar
- func (r *Registrar) BatchRenderer(...) *Registrar
- func (r *Registrar) BatchUpdateHooks(before func(bhpData models.BatchHookPointData) error, ...) *Registrar
- func (r *Registrar) CustomCreate(modelObj models.IModel, f func(db *gorm.DB) (*gorm.DB, error)) *Registrar
- func (r *Registrar) Model(modelObj models.IModel) *Registrar
- func (r *Registrar) ModelWithOption(modelObj models.IModel, options models.RegOptions) *Registrar
- func (r *Registrar) UserModel(modelObj models.IModel) *Registrar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Registrar ¶ added in v0.4.5
type Registrar struct {
// contains filtered or unexported fields
}
Registrar has registration methods for models
func (*Registrar) BatchCRUPDHooks ¶ added in v0.4.5
func (r *Registrar) BatchCRUPDHooks( before func(bhpData models.BatchHookPointData, op models.CRUPDOp) error, after func(bhpData models.BatchHookPointData, op models.CRUPDOp) error) *Registrar
BatchCRUPDHooks adds hookpoints which are called before CUPD (no read) and after batch CRUPD. Either one can be left as nil
func (*Registrar) BatchCreateHooks ¶ added in v0.4.5
func (r *Registrar) BatchCreateHooks( before func(bhpData models.BatchHookPointData) error, after func(bhpData models.BatchHookPointData) error) *Registrar
BatchCreateHooks adds hookpoints which are called before and after batch update. Either one can be left as nil
func (*Registrar) BatchDeleteHooks ¶ added in v0.4.5
func (r *Registrar) BatchDeleteHooks( before func(bhpData models.BatchHookPointData) error, after func(bhpData models.BatchHookPointData) error) *Registrar
BatchDeleteHooks adds hookpoints which are called before and after batch delete. Either one can be left as nil
func (*Registrar) BatchPatchHooks ¶ added in v0.4.5
func (r *Registrar) BatchPatchHooks( beforeApply func(bhpData models.BatchHookPointData) error, before func(bhpData models.BatchHookPointData) error, after func(bhpData models.BatchHookPointData) error) *Registrar
BatchPatchHooks adds hookpoints which are called before and after batch update. Either one can be left as nil
func (*Registrar) BatchReadHooks ¶ added in v0.4.5
func (r *Registrar) BatchReadHooks(after func(bhpData models.BatchHookPointData) error) *Registrar
BatchReadHooks adds hookpoints which are called after and read, can be left as nil
func (*Registrar) BatchRenderer ¶ added in v0.4.5
func (r *Registrar) BatchRenderer(renderer func(roles []models.UserRole, who models.Who, modelObj []models.IModel) []byte) *Registrar
BatchRenderer register custom batch renderer (do your own output, not necessarily JSON)
func (*Registrar) BatchUpdateHooks ¶ added in v0.4.5
func (r *Registrar) BatchUpdateHooks( before func(bhpData models.BatchHookPointData) error, after func(bhpData models.BatchHookPointData) error) *Registrar
BatchUpdateHooks adds hookpoints which are called before and after batch update. Either one can be left as nil
func (*Registrar) CustomCreate ¶ added in v0.4.5
func (r *Registrar) CustomCreate(modelObj models.IModel, f func(db *gorm.DB) (*gorm.DB, error)) *Registrar
CustomCreate register custom create table funtion
func (*Registrar) Model ¶ added in v0.4.5
Model adds a New function for an models.IModel (convenient function of RegModelWithOption)
func (*Registrar) ModelWithOption ¶ added in v0.4.5
ModelWithOption adds a New function for an models.IModel