Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func NewAuthHandler ¶
func NewAuthHandler(server *s.Server) *AuthHandler
func (*AuthHandler) Login ¶
func (authHandler *AuthHandler) Login(c echo.Context) error
Login godoc @Summary Authenticate a user @Description Perform user login @ID user-login @Tags User Actions @Accept json @Produce json @Param params body requests.LoginRequest true "User's credentials" @Success 200 {object} responses.LoginResponse @Failure 401 {object} responses.Error @Router /login [post]
func (*AuthHandler) RefreshToken ¶
func (authHandler *AuthHandler) RefreshToken(c echo.Context) error
Refresh godoc @Summary Refresh access token @Description Perform refresh access token @ID user-refresh @Tags User Actions @Accept json @Produce json @Param params body requests.RefreshRequest true "Refresh token" @Success 200 {object} responses.LoginResponse @Failure 401 {object} responses.Error @Router /refresh [post]
type PostHandlers ¶
type PostHandlers struct {
// contains filtered or unexported fields
}
func NewPostHandlers ¶
func NewPostHandlers(server *s.Server) *PostHandlers
func (*PostHandlers) CreatePost ¶
func (p *PostHandlers) CreatePost(c echo.Context) error
CreatePost godoc @Summary Create post @Description Create post @ID posts-create @Tags Posts Actions @Accept json @Produce json @Param params body requests.CreatePostRequest true "Post title and content" @Success 201 {object} responses.Data @Failure 400 {object} responses.Error @Security ApiKeyAuth @Router /posts [post]
func (*PostHandlers) DeletePost ¶
func (p *PostHandlers) DeletePost(c echo.Context) error
DeletePost godoc @Summary Delete post @Description Delete post @ID posts-delete @Tags Posts Actions @Param id path int true "Post ID" @Success 204 {object} responses.Data @Failure 404 {object} responses.Error @Security ApiKeyAuth @Router /posts/{id} [delete]
func (*PostHandlers) GetPosts ¶
func (p *PostHandlers) GetPosts(c echo.Context) error
GetPosts godoc @Summary Get posts @Description Get the list of all posts @ID posts-get @Tags Posts Actions @Produce json @Success 200 {array} responses.PostResponse @Security ApiKeyAuth @Router /posts [get]
func (*PostHandlers) UpdatePost ¶
func (p *PostHandlers) UpdatePost(c echo.Context) error
UpdatePost godoc @Summary Update post @Description Update post @ID posts-update @Tags Posts Actions @Accept json @Produce json @Param id path int true "Post ID" @Param params body requests.UpdatePostRequest true "Post title and content" @Success 200 {object} responses.Data @Failure 400 {object} responses.Error @Failure 404 {object} responses.Error @Security ApiKeyAuth @Router /posts/{id} [put]
type RegisterHandler ¶
type RegisterHandler struct {
// contains filtered or unexported fields
}
func NewRegisterHandler ¶
func NewRegisterHandler(server *s.Server) *RegisterHandler
func (*RegisterHandler) Register ¶
func (registerHandler *RegisterHandler) Register(c echo.Context) error
Register godoc @Summary Register @Description New user registration @ID user-register @Tags User Actions @Accept json @Produce json @Param params body requests.RegisterRequest true "User's email, user's password" @Success 201 {object} responses.Data @Failure 400 {object} responses.Error @Router /register [post]