Documentation
¶
Index ¶
- func CreateFacts(c *fiber.Ctx) error
- func CreateUser(c *fiber.Ctx) error
- func DeleteFact(c *fiber.Ctx) error
- func DeleteUser(c *fiber.Ctx) error
- func GetMe(c *fiber.Ctx) error
- func GetSingleFact(c *fiber.Ctx) error
- func GetUser(c *fiber.Ctx) error
- func ListFacts(c *fiber.Ctx) error
- func LoginUser(c *fiber.Ctx) error
- func LogoutUser(c *fiber.Ctx) error
- func RefreshAccessToken(c *fiber.Ctx) error
- func UpdateUser(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFacts ¶
func CreateFacts(c *fiber.Ctx) error
@Description Create a fact @Summary create a fact @Tags Facts @Accept json @Produce json @Param question body string true "Question" @Param answer body string true "Answer" @Success 200 {object} dto.FactsDTO @Failure 404 {object} string @Router /api/v1/facts [post]
func CreateUser ¶
func CreateUser(c *fiber.Ctx) error
@Description Create a new user @Summary create a new user @Tags Users @Accept json @Produce json @Param user body dto.UserLoginBodyDTO true "User" @Success 201 {object} dto.UserDTO @Failure 400 {object} string @Router /auth/v1/register [post]
func DeleteFact ¶
func DeleteFact(c *fiber.Ctx) error
@Description Delete a fact @Summary delete a fact @Tags Facts @Accept json @Produce json @Param id path int true "Fact ID" @Success 200 {object} dto.FactsDTO @Failure 404 {object} string @Router /api/v1/facts/{id} [delete]
func DeleteUser ¶
func DeleteUser(c *fiber.Ctx) error
@Description Delete a user with given id @Summary delete a user @Tags Users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} dto.UserDTO @Failure 400 {object} string @Router /auth/v1/users/{id} [delete]
func GetMe ¶
func GetMe(c *fiber.Ctx) error
@Description Get current user @Summary get current user @Tags Users @Accept json @Produce json @Success 200 {object} dto.UserDTO @Failure 400 {object} string @Router /auth/v1/users/me [get]
func GetSingleFact ¶
func GetSingleFact(c *fiber.Ctx) error
@Description Get a single fact @Summary get a single fact @Tags Facts @Accept json @Produce json @Param id path int true "Fact ID" @Success 200 {object} dto.FactsDTO @Failure 404 {object} string @Router /api/v1/facts/{id} [get]
func GetUser ¶
func GetUser(c *fiber.Ctx) error
@Description Get a user with given id @Summary get a user @Tags Users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} dto.UserDTO @Failure 400 {object} string @Router /auth/v1/users/{id} [get]
func ListFacts ¶
func ListFacts(c *fiber.Ctx) error
@Description List all facts @Summary get all facts @Tags Facts @Accept json @Produce json @Success 200 {object} []dto.FactsDTO @Failure 404 {object} string @Router /api/v1/facts [get]
func LoginUser ¶
func LoginUser(c *fiber.Ctx) error
@Description Login a user, returns access token, refresh token as cookies, user data and access token as json @Summary login a user @Tags Users @Accept json @Produce json @Param user body dto.UserLoginBodyDTO true "User" @Success 202 {object} dto.UserDTO @Failure 400 {object} string @Router /auth/v1/login [post]
func LogoutUser ¶
func LogoutUser(c *fiber.Ctx) error
@Description Logout a user, deletes refresh token from redis and access token from cookie @Summary logout a user @Tags Users @Accept json @Produce json @Success 200 {object} string @Failure 400 {object} string @Router /auth/v1/logout [get]
func RefreshAccessToken ¶
func RefreshAccessToken(c *fiber.Ctx) error
@Description Refresh access token @Summary refresh access token @Tags Users @Accept json @Produce json @Success 202 {object} dto.UserDTO @Failure 400 {object} string @Router /auth/v1/refresh [get]
func UpdateUser ¶
func UpdateUser(c *fiber.Ctx) error
@Description Update a user with given id @Summary update a user @Tags Users @Accept json @Produce json @Param id path int true "User ID" @Param user body dto.UserUpdateBodyDTO true "User" @Success 200 {object} dto.UserDTO @Failure 400 {object} string @Router /auth/v1/users/{id} [put]
Types ¶
This section is empty.