Documentation ¶
Index ¶
- Constants
- func AddAddHook[M AutoGqlHookM, I AutoGqlHookI, AP AutoGqlHookAP](db *AutoGqlDB, name AddName, implementation AutoGqlHookAdd[M, I, AP])
- func AddDeleteHook[F AutoGqlHookF, DP AutoGqlHookDP](db *AutoGqlDB, name DeleteName, implementation AutoGqlHookDelete[F, DP])
- func AddGetHook[T AutoGqlHookM, I any](db *AutoGqlDB, name GetName, implementation AutoGqlHookGet[T, I])
- func AddMany2ManyHook[U AutoGqlHookM2M, UP AutoGqlHookUP](db *AutoGqlDB, name Many2ManyName, implementation AutoGqlHookMany2Many[U, UP])
- func AddQueryHook[M AutoGqlHookM, F AutoGqlHookF, O AutoGqlHookQueryO](db *AutoGqlDB, name QueryName, implementation AutoGqlHookQuery[M, F, O])
- func AddUpdateHook[M AutoGqlHookM, U AutoGqlHookU, UP AutoGqlHookUP](db *AutoGqlDB, name UpdateName, implementation AutoGqlHookUpdate[U, UP])
- type AddName
- type AutoGqlDB
- type AutoGqlHookAP
- type AutoGqlHookAdd
- type AutoGqlHookDP
- type AutoGqlHookDelete
- type AutoGqlHookF
- type AutoGqlHookGet
- type AutoGqlHookI
- type AutoGqlHookM
- type AutoGqlHookM2M
- type AutoGqlHookMany2Many
- type AutoGqlHookQuery
- type AutoGqlHookQueryO
- type AutoGqlHookU
- type AutoGqlHookUP
- type AutoGqlHookUpdate
- type DefaultAddHook
- func (d DefaultAddHook[obj, inputType, resType]) BeforeCallDb(ctx context.Context, db *gorm.DB, data []obj) (*gorm.DB, []obj, error)
- func (d DefaultAddHook[obj, inputType, resType]) BeforeReturn(ctx context.Context, db *gorm.DB, data []obj, res *resType) (*resType, error)
- func (d DefaultAddHook[obj, inputType, resType]) Received(ctx context.Context, dbHelper *AutoGqlDB, input []*inputType) (*gorm.DB, []*inputType, error)
- type DefaultDeleteHook
- func (d DefaultDeleteHook[inputType, resType]) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error)
- func (d DefaultDeleteHook[inputType, resType]) BeforeReturn(ctx context.Context, db *gorm.DB, res *resType) (*resType, error)
- func (d DefaultDeleteHook[inputType, resType]) Received(ctx context.Context, dbHelper *AutoGqlDB, input *inputType) (*gorm.DB, inputType, error)
- type DefaultGetHook
- func (d DefaultGetHook[obj, identifier]) AfterCallDb(ctx context.Context, data *obj) (*obj, error)
- func (d DefaultGetHook[obj, identifier]) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error)
- func (d DefaultGetHook[obj, identifier]) BeforeReturn(ctx context.Context, data *obj, db *gorm.DB) (*obj, error)
- func (d DefaultGetHook[obj, identifier]) Received(ctx context.Context, dbHelper *AutoGqlDB, id ...identifier) (*gorm.DB, error)
- type DefaultMany2ManyHook
- func (d DefaultMany2ManyHook[inputType, resType]) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error)
- func (d DefaultMany2ManyHook[inputType, resType]) BeforeReturn(ctx context.Context, db *gorm.DB, res *resType) (*resType, error)
- func (d DefaultMany2ManyHook[inputType, resType]) Received(ctx context.Context, dbHelper *AutoGqlDB, input *inputType) (*gorm.DB, inputType, error)
- type DefaultQueryHook
- func (d DefaultQueryHook[obj, filter, order]) AfterCallDb(ctx context.Context, data []*obj) ([]*obj, error)
- func (d DefaultQueryHook[obj, filter, order]) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error)
- func (d DefaultQueryHook[obj, filter, order]) BeforeReturn(ctx context.Context, data []*obj, db *gorm.DB) ([]*obj, error)
- func (d DefaultQueryHook[obj, filterType, orderType]) Received(ctx context.Context, dbHelper *AutoGqlDB, filter *filterType, order *orderType, ...) (*gorm.DB, *filterType, *orderType, *int, *int, error)
- type DefaultUpdateHook
- func (d DefaultUpdateHook[inputType, resType]) BeforeCallDb(ctx context.Context, db *gorm.DB, data map[string]interface{}) (*gorm.DB, map[string]interface{}, error)
- func (d DefaultUpdateHook[inputType, resType]) BeforeReturn(ctx context.Context, db *gorm.DB, res *resType) (*resType, error)
- func (d DefaultUpdateHook[inputType, resType]) Received(ctx context.Context, dbHelper *AutoGqlDB, input *inputType) (*gorm.DB, inputType, error)
- type DeleteName
- type GetName
- type Many2ManyName
- type QueryName
- type UpdateName
Constants ¶
View Source
const ( GetCat GetName = "GetCat" QueryCat QueryName = "QueryCat" AddCat AddName = "AddCat" UpdateCat UpdateName = "UpdateCat" DeleteCat DeleteName = "DeleteCat" GetCompany GetName = "GetCompany" QueryCompany QueryName = "QueryCompany" AddCompany AddName = "AddCompany" UpdateCompany UpdateName = "UpdateCompany" DeleteCompany DeleteName = "DeleteCompany" GetSmartPhone GetName = "GetSmartPhone" QuerySmartPhone QueryName = "QuerySmartPhone" AddSmartPhone AddName = "AddSmartPhone" UpdateSmartPhone UpdateName = "UpdateSmartPhone" DeleteSmartPhone DeleteName = "DeleteSmartPhone" AddUser2Todos Many2ManyName = "AddUser2Todos" GetTodo GetName = "GetTodo" QueryTodo QueryName = "QueryTodo" AddTodo AddName = "AddTodo" UpdateTodo UpdateName = "UpdateTodo" DeleteTodo DeleteName = "DeleteTodo" GetUser GetName = "GetUser" QueryUser QueryName = "QueryUser" AddUser AddName = "AddUser" UpdateUser UpdateName = "UpdateUser" DeleteUser DeleteName = "DeleteUser" )
Variables ¶
This section is empty.
Functions ¶
func AddAddHook ¶
func AddAddHook[M AutoGqlHookM, I AutoGqlHookI, AP AutoGqlHookAP](db *AutoGqlDB, name AddName, implementation AutoGqlHookAdd[M, I, AP])
func AddDeleteHook ¶
func AddDeleteHook[F AutoGqlHookF, DP AutoGqlHookDP](db *AutoGqlDB, name DeleteName, implementation AutoGqlHookDelete[F, DP])
func AddGetHook ¶
func AddGetHook[T AutoGqlHookM, I any](db *AutoGqlDB, name GetName, implementation AutoGqlHookGet[T, I])
func AddMany2ManyHook ¶
func AddMany2ManyHook[U AutoGqlHookM2M, UP AutoGqlHookUP](db *AutoGqlDB, name Many2ManyName, implementation AutoGqlHookMany2Many[U, UP])
func AddQueryHook ¶
func AddQueryHook[M AutoGqlHookM, F AutoGqlHookF, O AutoGqlHookQueryO](db *AutoGqlDB, name QueryName, implementation AutoGqlHookQuery[M, F, O])
func AddUpdateHook ¶
func AddUpdateHook[M AutoGqlHookM, U AutoGqlHookU, UP AutoGqlHookUP](db *AutoGqlDB, name UpdateName, implementation AutoGqlHookUpdate[U, UP])
Types ¶
type AutoGqlDB ¶
func NewAutoGqlDB ¶
type AutoGqlHookAP ¶
type AutoGqlHookAP interface { model.AddCatPayload | model.AddCompanyPayload | model.AddSmartPhonePayload | model.AddTodoPayload | model.AddUserPayload }
type AutoGqlHookAdd ¶
type AutoGqlHookAdd[obj AutoGqlHookM, input AutoGqlHookI, res AutoGqlHookAP] interface { Received(ctx context.Context, dbHelper *AutoGqlDB, input []*input) (*gorm.DB, []*input, error) BeforeCallDb(ctx context.Context, db *gorm.DB, data []obj) (*gorm.DB, []obj, error) BeforeReturn(ctx context.Context, db *gorm.DB, data []obj, res *res) (*res, error) }
type AutoGqlHookDP ¶
type AutoGqlHookDP interface { model.DeleteCatPayload | model.DeleteCompanyPayload | model.DeleteSmartPhonePayload | model.DeleteTodoPayload | model.DeleteUserPayload }
type AutoGqlHookDelete ¶
type AutoGqlHookDelete[input AutoGqlHookF, res AutoGqlHookDP] interface { Received(ctx context.Context, dbHelper *AutoGqlDB, input *input) (*gorm.DB, input, error) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error) BeforeReturn(ctx context.Context, db *gorm.DB, res *res) (*res, error) }
type AutoGqlHookF ¶
type AutoGqlHookF interface { model.CatFiltersInput | model.CompanyFiltersInput | model.SmartPhoneFiltersInput | model.TodoFiltersInput | model.UserFiltersInput }
type AutoGqlHookGet ¶
type AutoGqlHookGet[obj AutoGqlHookM, identifier any] interface { Received(ctx context.Context, dbHelper *AutoGqlDB, id ...identifier) (*gorm.DB, error) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error) AfterCallDb(ctx context.Context, data *obj) (*obj, error) BeforeReturn(ctx context.Context, data *obj, db *gorm.DB) (*obj, error) }
type AutoGqlHookI ¶
type AutoGqlHookI interface { model.CatInput | model.CompanyInput | model.SmartPhoneInput | model.TodoInput | model.UserInput }
type AutoGqlHookM ¶
type AutoGqlHookM2M ¶
type AutoGqlHookM2M interface { model.UserRef2TodosInput }
type AutoGqlHookMany2Many ¶
type AutoGqlHookMany2Many[input AutoGqlHookM2M, res AutoGqlHookUP] interface { Received(ctx context.Context, dbHelper *AutoGqlDB, input *input) (*gorm.DB, input, error) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error) BeforeReturn(ctx context.Context, db *gorm.DB, res *res) (*res, error) }
type AutoGqlHookQuery ¶
type AutoGqlHookQuery[obj AutoGqlHookM, filter AutoGqlHookF, order AutoGqlHookQueryO] interface { Received(ctx context.Context, dbHelper *AutoGqlDB, filter *filter, order *order, first, offset *int) (*gorm.DB, *filter, *order, *int, *int, error) BeforeCallDb(ctx context.Context, db *gorm.DB) (*gorm.DB, error) AfterCallDb(ctx context.Context, data []*obj) ([]*obj, error) BeforeReturn(ctx context.Context, data []*obj, db *gorm.DB) ([]*obj, error) }
type AutoGqlHookQueryO ¶
type AutoGqlHookQueryO interface { model.CatOrder | model.CompanyOrder | model.SmartPhoneOrder | model.TodoOrder | model.UserOrder }
type AutoGqlHookU ¶
type AutoGqlHookU interface { model.UpdateCatInput | model.UpdateCompanyInput | model.UpdateSmartPhoneInput | model.UpdateTodoInput | model.UpdateUserInput }
type AutoGqlHookUP ¶
type AutoGqlHookUP interface { model.UpdateCatPayload | model.UpdateCompanyPayload | model.UpdateSmartPhonePayload | model.UpdateTodoPayload | model.UpdateUserPayload }
type AutoGqlHookUpdate ¶
type AutoGqlHookUpdate[input AutoGqlHookU, res AutoGqlHookUP] interface { Received(ctx context.Context, dbHelper *AutoGqlDB, input *input) (*gorm.DB, input, error) BeforeCallDb(ctx context.Context, db *gorm.DB, data map[string]interface{}) (*gorm.DB, map[string]interface{}, error) BeforeReturn(ctx context.Context, db *gorm.DB, res *res) (*res, error) }
type DefaultAddHook ¶
type DefaultAddHook[obj AutoGqlHookM, input AutoGqlHookI, res AutoGqlHookAP] struct{}
func (DefaultAddHook[obj, inputType, resType]) BeforeCallDb ¶
func (DefaultAddHook[obj, inputType, resType]) BeforeReturn ¶
type DefaultDeleteHook ¶
type DefaultDeleteHook[input AutoGqlHookF, res AutoGqlHookDP] struct{}
func (DefaultDeleteHook[inputType, resType]) BeforeCallDb ¶
func (DefaultDeleteHook[inputType, resType]) BeforeReturn ¶
type DefaultGetHook ¶
type DefaultGetHook[obj AutoGqlHookM, identifier any] struct{}
func (DefaultGetHook[obj, identifier]) AfterCallDb ¶
func (d DefaultGetHook[obj, identifier]) AfterCallDb(ctx context.Context, data *obj) (*obj, error)
func (DefaultGetHook[obj, identifier]) BeforeCallDb ¶
func (DefaultGetHook[obj, identifier]) BeforeReturn ¶
type DefaultMany2ManyHook ¶
type DefaultMany2ManyHook[input AutoGqlHookM2M, res AutoGqlHookUP] struct{}
func (DefaultMany2ManyHook[inputType, resType]) BeforeCallDb ¶
func (DefaultMany2ManyHook[inputType, resType]) BeforeReturn ¶
type DefaultQueryHook ¶
type DefaultQueryHook[obj AutoGqlHookM, filter AutoGqlHookF, order AutoGqlHookQueryO] struct{}
func (DefaultQueryHook[obj, filter, order]) AfterCallDb ¶
func (d DefaultQueryHook[obj, filter, order]) AfterCallDb(ctx context.Context, data []*obj) ([]*obj, error)
func (DefaultQueryHook[obj, filter, order]) BeforeCallDb ¶
func (DefaultQueryHook[obj, filter, order]) BeforeReturn ¶
type DefaultUpdateHook ¶
type DefaultUpdateHook[input AutoGqlHookU, res AutoGqlHookUP] struct{}
func (DefaultUpdateHook[inputType, resType]) BeforeCallDb ¶
func (DefaultUpdateHook[inputType, resType]) BeforeReturn ¶
type DeleteName ¶
type DeleteName string
type Many2ManyName ¶
type Many2ManyName string
type UpdateName ¶
type UpdateName string
Click to show internal directories.
Click to hide internal directories.