Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(userManager *usermanager.UserManager) (*Handler, error)
func (*Handler) CreateUser ¶
func (h *Handler) CreateUser() http.HandlerFunc
@Id createUser @Summary Create user @Description Create a new user @Tags user @Accept json @Produce json @Param user body request.CreateUserRequest true "Created user" @Success 200 {object} handler.Response{data=entity.User} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Security BasicAuth @Router /api/v1/users [post]
func (*Handler) DeleteUser ¶
func (h *Handler) DeleteUser() http.HandlerFunc
@Id deleteUser @Summary Delete user @Description Delete specified user by ID @Tags user @Produce json @Param id path string true "User ID" @Success 200 {object} handler.Response{data=string} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Security BasicAuth @Router /api/v1/users/{id} [delete]
func (*Handler) GetUser ¶
func (h *Handler) GetUser() http.HandlerFunc
@Id getUser @Summary Get user @Description Get user information by user ID @Tags user @Produce json @Param id path string true "User ID" @Success 200 {object} handler.Response{data=entity.User} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Security BasicAuth @Router /api/v1/users/{id} [get]
func (*Handler) ListUsers ¶
func (h *Handler) ListUsers() http.HandlerFunc
@Id listUser @Summary List users @Description List all users @Tags user @Produce json @Success 200 {object} handler.Response{data=[]entity.User} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Security BasicAuth @Router /api/v1/users [get]
func (*Handler) UpdateUser ¶
func (h *Handler) UpdateUser() http.HandlerFunc
@Id updateUser @Summary Update user @Description Update the specified user @Tags user @Accept json @Produce json @Param id path string true "User ID" @Param user body request.UpdateUserRequest true "Updated user" @Success 200 {object} handler.Response{data=entity.User} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Security BasicAuth @Router /api/v1/users/{id} [put]