Documentation
¶
Index ¶
- type CRUD
- func (q *CRUD[Model]) WithCreate(f CreateQueryFunc) *CRUD[Model]
- func (q *CRUD[Model]) WithDestroy(f DestroyQueryFunc) *CRUD[Model]
- func (q *CRUD[Model]) WithList(f ListQueryFunc) *CRUD[Model]
- func (q *CRUD[Model]) WithRetrieve(f RetrieveQueryFunc) *CRUD[Model]
- func (q *CRUD[Model]) WithUpdate(f UpdateQueryFunc) *CRUD[Model]
- type CreateQueryFunc
- type DestroyQueryFunc
- type ListQueryFunc
- type RetrieveQueryFunc
- type UpdateQueryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRUD ¶
type CRUD[Model any] struct { List ListQueryFunc Retrieve RetrieveQueryFunc Create CreateQueryFunc Update UpdateQueryFunc Destroy DestroyQueryFunc }
CRUD is a collection of queries that are executed by the views
func (*CRUD[Model]) WithCreate ¶
func (q *CRUD[Model]) WithCreate(f CreateQueryFunc) *CRUD[Model]
func (*CRUD[Model]) WithDestroy ¶
func (q *CRUD[Model]) WithDestroy(f DestroyQueryFunc) *CRUD[Model]
func (*CRUD[Model]) WithList ¶
func (q *CRUD[Model]) WithList(f ListQueryFunc) *CRUD[Model]
func (*CRUD[Model]) WithRetrieve ¶
func (q *CRUD[Model]) WithRetrieve(f RetrieveQueryFunc) *CRUD[Model]
func (*CRUD[Model]) WithUpdate ¶
func (q *CRUD[Model]) WithUpdate(f UpdateQueryFunc) *CRUD[Model]
type CreateQueryFunc ¶
type CreateQueryFunc func(ctx *gin.Context, new models.InternalValue) (models.InternalValue, error)
CreateQueryFunc is a function that executes a create query.
type DestroyQueryFunc ¶
DestroyQueryFunc is a function that executes a delete query.
type ListQueryFunc ¶
type ListQueryFunc func(ctx *gin.Context) ([]models.InternalValue, error)
ListQueryFunc is a function that executes a list query.
type RetrieveQueryFunc ¶
RetrieveQueryFunc is a function that executes a retrieve query.
type UpdateQueryFunc ¶
type UpdateQueryFunc func(ctx *gin.Context, old models.InternalValue, new models.InternalValue, id any) ( models.InternalValue, error, )
UpdateQueryFunc is a function that executes an update query.
Click to show internal directories.
Click to hide internal directories.