Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewMainController), fx.Provide(NewUserController), fx.Provide(NewAuthController), fx.Provide(NewPostController), )
Functions ¶
This section is empty.
Types ¶
type AuthController ¶
type AuthController struct {
// contains filtered or unexported fields
}
func NewAuthController ¶
func NewAuthController(authService services.AuthService) AuthController
func (AuthController) Login ¶
func (c AuthController) Login(ctx echo.Context) error
Login godoc
@Summary Login a User @Description Login as user to application @Tags auth @Accept application/json @Produce application/json @Param data body dto.LoginRequest true "Post" @Router /login [post] @Success 200 {object} response.Response{data=dto.LoginResponse} "ok" @Failure 400 {object} response.Response{data=[]response.ValidationErrors} "bad request"
func (AuthController) Register ¶
func (c AuthController) Register(ctx echo.Context) error
Register godoc
@Summary Register a new User @Description register a new user @Tags auth @Accept application/json @Produce application/json @Param data body dto.RegisterRequest true "Post" @Router /register [post] @Success 200 {object} response.Response{data=dto.RegisterResponse} "ok" @Failure 400 {object} response.Response{data=[]response.ValidationErrors} "bad request"
type MainController ¶
type MainController struct {
// contains filtered or unexported fields
}
func NewMainController ¶
func NewMainController(config lib.Config) MainController
func (MainController) Index ¶
func (c MainController) Index(ctx echo.Context) error
type PostController ¶
type PostController struct {
// contains filtered or unexported fields
}
func NewPostController ¶
func NewPostController(postService services.PostService, postPolicy policies.PostPolicy, authService services.AuthService) PostController
func (PostController) Create ¶
func (c PostController) Create(ctx echo.Context) error
Create godoc
@Summary Create a post @Description Create a post @Tags post @Accept application/json @Produce application/json @Security BearerAuth @Param data body dto.PostRequest true "Post" @Router /posts [post] @Success 201 {object} response.Response{data=dto.PostResponse} "created" @Failure 400 {object} response.Response{data=[]response.ValidationErrors} "bad request" @Failure 404 {object} response.Response "not found" @Failure 401 {object} response.Response "unauthorized" @Failure 403 {object} response.Response "forbidden"
func (PostController) Destroy ¶
func (c PostController) Destroy(ctx echo.Context) error
Destroy godoc
@summary Delete a post @Description perform delete a post @Param id path string true "post id" @Tags post @Accept application/json @Produce application/json @Security BearerAuth @Router /posts/{id} [delete] @Success 204 {object} nil "no content" @Failure 404 {object} response.Response "not found" @Failure 401 {object} response.Response "unauthorized" @Failure 403 {object} response.Response "forbidden"
func (PostController) Detail ¶
func (c PostController) Detail(ctx echo.Context) error
Detail godoc
@Summary Detail a post @Description get detail a post @Param id path string true "post id" @Tags post @Accept application/json @Produce application/json @Router /posts/{id} [get] @Success 200 {object} response.Response{data=dto.PostResponse} "ok" @Failure 404 {object} response.Response{} "not found"
func (PostController) List ¶
func (c PostController) List(ctx echo.Context) error
List godoc
@Summary List several posts @Description get list several posts @Tags post @Accept application/json @Produce application/json @Router /posts [get] @Success 200 {object} response.Response{data=dto.PostPaginationResponse} "ok" @Failure 400 {object} response.Response{data=[]response.ValidationErrors} "bad request"
func (PostController) Update ¶
func (c PostController) Update(ctx echo.Context) error
Update godoc
@Summary Update a post @Description Update a post @Tags post @Accept application/json @Produce application/json @Security BearerAuth @Param data body dto.PostRequest true "Post" @Router /posts/{id} [patch] @Success 200 {object} response.Response "ok" @Failure 400 {object} response.Response{data=[]response.ValidationErrors} "bad request" @Failure 404 {object} response.Response "not found" @Failure 401 {object} response.Response "unauthorized" @Failure 403 {object} response.Response "forbidden"
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
func NewUserController ¶
func NewUserController(userService services.UserService, authService services.AuthService, userPolicy policies.UserPolicy) UserController
func (UserController) Destroy ¶
func (c UserController) Destroy(ctx echo.Context) error
Destroy godoc
@Summary Delete a User @Description perform delete a user by username @Tags user @Accept application/json @Produce application/json @Security BearerAuth @Param username path string true "Username" @Router /users/{username} [delete] @Success 204 {object} nil "no content" @Failure 404 {object} response.Response "not found" @Failure 401 {object} response.Response "unauthorized" @Failure 403 {object} response.Response "forbidden"
func (UserController) Detail ¶
func (c UserController) Detail(ctx echo.Context) error
Detail godoc
@Summary Get a User @Description get a user by username @Tags user @Accept application/json @Produce application/json @Param username path string true "Username" @Router /users/{username} [get] @Success 200 {object} response.Response{data=dto.UserResponse} "ok" @Failure 404 {object} response.Response "not found"
func (UserController) List ¶
func (c UserController) List(ctx echo.Context) error
List godoc
@Summary List several users @Description get list several users @Tags user @Accept application/json @Produce application/json @Router /users [get] @Success 200 {object} response.Response{data=dto.UserPaginationResponse} "ok" @Failure 400 {object} response.Response{data=[]response.ValidationErrors} "bad request"
Click to show internal directories.
Click to hide internal directories.