Documentation ¶
Index ¶
- func CreateRoutes(service usr.Service, v *validator.Validate) *fiber.App
- func CreateUser(service usr.Service, v *validator.Validate) fiber.Handler
- func DeleteUser(service usr.Service) fiber.Handler
- func GetAllUsers(service usr.Service) fiber.Handler
- func GetUserByEmail(service usr.Service) fiber.Handler
- func GetUserByID(service usr.Service) fiber.Handler
- func Healthcheck() fiber.Handler
- func UpdateUser(service usr.Service) fiber.Handler
- type CreateUserRequest
- type HealthCheckResponse
- type HttpError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRoutes ¶
@license.name MIT @license.url https://github.com/millbj92/nuboverflow-users/blob/main/LICENSE
func CreateUser ¶
CreateUser godoc @Summary Create a user @Description add by json user @Tags users @Accept json @Produce json @Param account body model.CreateUser true "Create user" @Success 200 {object} model.User @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts [post]
func DeleteUser ¶
DeleteUser godoc @Summary Delete a user @Description Delete by user ID @Tags users @Accept json @Produce json @Param id path int true "User ID" Format(int64) @Success 204 {object} model.User @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /users/{id} [delete]
func GetAllUsers ¶
GetAllUsers godoc @Summary List all users @Description Get all user accounts @Tags users @Produce json @Success 200 {object} model.User @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /users [get]
func GetUserByEmail ¶
GetUserByEmail godoc @Summary Get a user by their email address. @Description get user by ID @Tags users @Accept string @Produce json @Param q query string false "user search by q" Format(email) @Success 200 {object} model.User @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /users/{email} [get]
func GetUserByID ¶
GetUserByID godoc @Summary Get a single user by their ID @Description get user by ID @Tags users @Accept int @Produce json @Param id path int true "User ID" @Success 200 {object} model.User @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /users/{id} [get]
func Healthcheck ¶
func Healthcheck() fiber.Handler
Healthcheck godoc @Summary Healthcheck the Users API @Description Ping this endpoint to get a current healthcheck. @Tags users @Produce string @Success 200 {object} string @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /users/ping [get]
func UpdateUser ¶
UpdateUser godoc @Summary Update a user @Description update by json user @Tags users @Accept json @Produce json @Param user body model.UpdateUser true "Update user" @Success 200 {object} model.User @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts [put]