controllers

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBook added in v1.2.0

func CreateBook(c *fiber.Ctx) error

CreateBook func for creates a new book. @Description Create a new book. @Summary create a new book @Tags Book @Accept json @Produce json @Param title body string true "Title" @Param author body string true "Author" @Param user_id body string true "User ID" @Param book_attrs body models.BookAttrs true "Book attributes" @Success 200 {object} models.Book @Security ApiKeyAuth @Router /v1/book [post]

func DeleteBook added in v1.2.0

func DeleteBook(c *fiber.Ctx) error

DeleteBook func for deletes book by given ID. @Description Delete book by given ID. @Summary delete book by given ID @Tags Book @Accept json @Produce json @Param id body string true "Book ID" @Success 204 {string} status "ok" @Security ApiKeyAuth @Router /v1/book [delete]

func GetBook added in v1.2.0

func GetBook(c *fiber.Ctx) error

GetBook func gets book by given ID or 404 error. @Description Get book by given ID. @Summary get book by given ID @Tags Book @Accept json @Produce json @Param id path string true "Book ID" @Success 200 {object} models.Book @Router /v1/book/{id} [get]

func GetBooks added in v1.2.0

func GetBooks(c *fiber.Ctx) error

GetBooks func gets all exists books. @Description Get all exists books. @Summary get all exists books @Tags Books @Accept json @Produce json @Success 200 {array} models.Book @Router /v1/books [get]

func RenewTokens added in v1.2.0

func RenewTokens(c *fiber.Ctx) error

RenewTokens method for renew access and refresh tokens. @Description Renew access and refresh tokens. @Summary renew access and refresh tokens @Tags Token @Accept json @Produce json @Param refresh_token body string true "Refresh token" @Success 200 {string} status "ok" @Security ApiKeyAuth @Router /v1/token/renew [post]

func UpdateBook added in v1.2.0

func UpdateBook(c *fiber.Ctx) error

UpdateBook func for updates book by given ID. @Description Update book. @Summary update book @Tags Book @Accept json @Produce json @Param id body string true "Book ID" @Param title body string true "Title" @Param author body string true "Author" @Param user_id body string true "User ID" @Param book_status body integer true "Book status" @Param book_attrs body models.BookAttrs true "Book attributes" @Success 202 {string} status "ok" @Security ApiKeyAuth @Router /v1/book [put]

func UserSignIn added in v1.2.0

func UserSignIn(c *fiber.Ctx) error

UserSignIn method to auth user and return access and refresh tokens. @Description Auth user and return access and refresh token. @Summary auth user and return access and refresh token @Tags User @Accept json @Produce json @Param email body string true "User Email" @Param password body string true "User Password" @Success 200 {string} status "ok" @Router /v1/user/sign/in [post]

func UserSignOut added in v1.2.0

func UserSignOut(c *fiber.Ctx) error

UserSignOut method to de-authorize user and delete refresh token from Redis. @Description De-authorize user and delete refresh token from Redis. @Summary de-authorize user and delete refresh token from Redis @Tags User @Accept json @Produce json @Success 204 {string} status "ok" @Security ApiKeyAuth @Router /v1/user/sign/out [post]

func UserSignUp added in v1.2.0

func UserSignUp(c *fiber.Ctx) error

UserSignUp method to create a new user. @Description Create a new user. @Summary create a new user @Tags User @Accept json @Produce json @Param email body string true "Email" @Param password body string true "Password" @Param user_role body string true "User role" @Success 200 {object} models.User @Router /v1/user/sign/up [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

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