Documentation ¶
Index ¶
- Variables
- func All(c *fiber.Ctx) error
- func CreateUser(c *fiber.Ctx) error
- func DeleteBook(c *fiber.Ctx) error
- func DeleteUser(c *fiber.Ctx) error
- func GetBook(c *fiber.Ctx) error
- func GetBooks(c *fiber.Ctx) error
- func GetChat() []model.Chat
- func GetUser(c *fiber.Ctx) error
- func GetUserAuth(c *fiber.Ctx) error
- func Login(c *fiber.Ctx) error
- func Logout(c *fiber.Ctx) error
- func NewBook(c *fiber.Ctx) error
- func NewMessage(chat model.Chat) string
- func UpdateBook(c *fiber.Ctx) error
- func UpdateUser(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
var Input model.LoginInput
Functions ¶
func All ¶
func All(c *fiber.Ctx) error
All godoc @Tags user @Summary Get all users @Produce json @Param page query int false "page" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 404 "Not found" @Router /api/user [get] @Security ApiKeyAuth
func CreateUser ¶
func CreateUser(c *fiber.Ctx) error
CreateUser godoc @Tags user @Summary Create a user @ID get-string-by-int @Accept json @Produce json @Param user body model.User true "User model" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 500 "Internal Server Error" @Router /api/user [post] @Security ApiKeyAuth
func DeleteBook ¶
func DeleteBook(c *fiber.Ctx) error
DeleteBook godoc @Tags book @Summary Delete a book @Produce json @Param id path int true "Delete ID" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 404 "Not found" @Router /api/book/{id} [delete] @Security ApiKeyAuth
func DeleteUser ¶
func DeleteUser(c *fiber.Ctx) error
DeleteUser godoc @Tags user @Summary Delete a user @Accept json @Produce json @Param id path int true "Delete ID" @Param user body model.PasswordInput true "Delete User model" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 500 "Internal Server Error" @Router /api/user/{id} [delete] @Security ApiKeyAuth
func GetBook ¶
func GetBook(c *fiber.Ctx) error
GetBook godoc @Tags book @Summary Show a book @Produce json @Param id path int true "Book ID" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 404 "Not found" @Router /api/book/{id} [get] @Security ApiKeyAuth
func GetBooks ¶
func GetBooks(c *fiber.Ctx) error
GetBooks godoc @Tags book @Summary Show all books @Produce json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Router /api/book [get] @Security ApiKeyAuth
func GetChat ¶
GetChat godoc @Tags chat @Summary Show all messages @Produce json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Router / [get] @Security ApiKeyAuth
func GetUser ¶
func GetUser(c *fiber.Ctx) error
GetUser godoc @Tags user @Summary Show user by id @Produce json @Param id path int true "User ID" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Router /api/user/{id} [get] @Security ApiKeyAuth
func GetUserAuth ¶
func GetUserAuth(c *fiber.Ctx) error
GetUserAuth godoc @Tags user @Summary Get ID User auth @Produce json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 404 "Not found" @Router /api/user/user_auth [get] @Security ApiKeyAuth
func Login ¶
func Login(c *fiber.Ctx) error
Login godoc @Tags auth @Summary Login to api @Accept json @Param user body model.LoginInput true "User login model" @Success 202 "Accepted" @Failure 400 "Bab Request" @Failure 401 "Unauthorized" @Failure 404 "Not Found" @Failure 500 "Internal Server Error" @Router /auth/login [post]
func Logout ¶
func Logout(c *fiber.Ctx) error
Logout godoc @Tags auth @Summary Logout from api @Accept json @Success 202 "Accepted" @Failure 401 "Unauthorized" @Failure 404 "Not Found" @Failure 500 "Internal Server Error" @Router /auth/logout [get]
func NewBook ¶
func NewBook(c *fiber.Ctx) error
NewBook godoc @Tags book @Summary Create a book @ID get-string-by-int @Accept json @Produce json @Param book body model.Book true "Book model" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Router /api/book [post] @Security ApiKeyAuth
func NewMessage ¶
NewMessage godoc @Tags chat @Summary Receive a message @ID get-string-by-int @Accept json @Produce json @Param chat body model.Chat true "Book model" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Router / [post] @Security ApiKeyAuth
func UpdateBook ¶
func UpdateBook(c *fiber.Ctx) error
UpdateBook godoc @Tags book @Summary Update a book @Accept json @Produce json @Param id path int true "Book ID" @Param book body model.Book true "Book model" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 404 "Not found" @Router /api/book/{id} [put] @Security ApiKeyAuth
func UpdateUser ¶
func UpdateUser(c *fiber.Ctx) error
UpdateUser godoc @Tags user @Summary Update a user @Accept json @Produce json @Param id path int true "User ID" @Param user body model.UpdateUserInput true "Update User model" @Success 200 "OK" @Failure 400 "Bad Request" @Failure 401 "Unauthorized" @Failure 404 "Not Found" @Failure 500 "Internal Server Error" @Router /api/user/{id} [put] @Security ApiKeyAuth
Types ¶
This section is empty.