handler

package
v0.0.0-...-8bbae97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

func GetChat() []model.Chat

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

func NewMessage(chat model.Chat) string

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL