Documentation ¶
Index ¶
- type BaseControl
- func (ctrl *BaseControl) Delete(ctx *gin.Context)
- func (ctrl *BaseControl) GetAll(ctx *gin.Context)
- func (ctrl *BaseControl) GetByID(ctx *gin.Context)
- func (ctrl *BaseControl) Head(ctx *gin.Context)
- func (ctrl *BaseControl) Init(db *gorm.DB, validate *validator.Validate, redis *redis.Client, ...)
- func (ctrl *BaseControl) Options(ctx *gin.Context)
- func (ctrl *BaseControl) Patch(ctx *gin.Context)
- func (ctrl *BaseControl) Post(ctx *gin.Context)
- func (ctrl *BaseControl) Prepare()
- type Controller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseControl ¶
type BaseControl struct { DB *gorm.DB Validator *validator.Validate RedisClient *redis.Client Model interface{} }
BaseControl representing the structure of a RESTful API handler
func (*BaseControl) Delete ¶
func (ctrl *BaseControl) Delete(ctx *gin.Context)
Delete corresponds http Delete method
func (*BaseControl) GetAll ¶
func (ctrl *BaseControl) GetAll(ctx *gin.Context)
GetAll corresponds http Get method
func (*BaseControl) GetByID ¶
func (ctrl *BaseControl) GetByID(ctx *gin.Context)
GetByID corresponds http Get :id method
func (*BaseControl) Head ¶
func (ctrl *BaseControl) Head(ctx *gin.Context)
Head corresponds http Head method
func (*BaseControl) Init ¶
func (ctrl *BaseControl) Init(db *gorm.DB, validate *validator.Validate, redis *redis.Client, model interface{})
Init inits the Control data
func (*BaseControl) Options ¶
func (ctrl *BaseControl) Options(ctx *gin.Context)
Options corresponds http Options method
func (*BaseControl) Patch ¶
func (ctrl *BaseControl) Patch(ctx *gin.Context)
Patch corresponds http Patch method
func (*BaseControl) Post ¶
func (ctrl *BaseControl) Post(ctx *gin.Context)
Post corresponds http Post method
func (*BaseControl) Prepare ¶
func (ctrl *BaseControl) Prepare()
Prepare corresponds http Prepare method
type Controller ¶
type Controller interface { Init(...interface{}) Prepare() Post(ctx *gin.Context) Patch(ctx *gin.Context) Delete(ctx *gin.Context) GetByID(ctx *gin.Context) GetAll(ctx *gin.Context) Head(ctx *gin.Context) Options(ctx *gin.Context) }
Controller is an control interface based on go-gin
Click to show internal directories.
Click to hide internal directories.