Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthController ¶
type AuthController struct { Controller // contains filtered or unexported fields }
func NewAuthController ¶
func NewAuthController(store *oauth2.Store) *AuthController
func (AuthController) Client ¶
func (controller AuthController) Client(c *gin.Context)
func (AuthController) Profile ¶
func (controller AuthController) Profile(c *gin.Context)
func (AuthController) Register ¶
func (controller AuthController) Register(c *gin.Context)
func (AuthController) Token ¶
func (controller AuthController) Token(c *gin.Context)
type CategoryController ¶
type CategoryController struct {
Controller
}
func NewCategoryController ¶
func NewCategoryController() *CategoryController
func (CategoryController) Destroy ¶
func (controller CategoryController) Destroy(c *gin.Context)
Destroy deletes category by id
func (CategoryController) Index ¶
func (controller CategoryController) Index(c *gin.Context)
Index return all categories
func (CategoryController) Store ¶
func (controller CategoryController) Store(c *gin.Context)
Store stores new category
func (CategoryController) Update ¶
func (controller CategoryController) Update(c *gin.Context)
Update updates category by id
func (CategoryController) View ¶
func (controller CategoryController) View(c *gin.Context)
View returns category by given id
type Controller ¶
type Controller struct{}
func (Controller) Deleted ¶
func (ctl Controller) Deleted(c *gin.Context)
func (Controller) ErrorResponse ¶
func (ctl Controller) ErrorResponse(c *gin.Context, statusCode int, message string)
func (Controller) SuccessResponse ¶
func (ctl Controller) SuccessResponse(c *gin.Context, data interface{})
type PostController ¶
type PostController struct {
Controller
}
func NewPostController ¶
func NewPostController() *PostController
func (PostController) Destroy ¶
func (controller PostController) Destroy(c *gin.Context)
Destroy deletes post by id
func (PostController) Index ¶
func (controller PostController) Index(c *gin.Context)
Index return all posts
func (PostController) Store ¶
func (controller PostController) Store(c *gin.Context)
Store stores new post
func (PostController) Update ¶
func (controller PostController) Update(c *gin.Context)
Update updates post by id
func (PostController) View ¶
func (controller PostController) View(c *gin.Context)
View return post by id
type PostValidate ¶
type PostValidate struct { Title string `form:"title" binding:"required,max=100,min=2"` Image *multipart.FileHeader `form:"image" binding:"required"` Description string `form:"description" binding:"required,max=100,min=2"` Body string `form:"body" binding:"required,min=2"` Category string `form:"category" binding:"required"` }
type PostValidateUpdate ¶
Click to show internal directories.
Click to hide internal directories.