controllers

package
v0.0.0-...-308311b Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccount

func CreateAccount(c *fiber.Ctx) error

CreateAccount func for creates a new account. @Description Create a new account. @Summary create a new account @Tags Account @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 account_attrs body models.AccountAttrs true "Account attributes" @Success 200 {object} models.Account @Security ApiKeyAuth @Router /v1/account [post]

func DeleteAccount

func DeleteAccount(c *fiber.Ctx) error

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

func GetAccount

func GetAccount(c *fiber.Ctx) error

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

func GetAccounts

func GetAccounts(c *fiber.Ctx) error

GetAccounts func gets all exists accounts. @Description Get all exists accounts. @Summary get all exists accounts @Tags Accounts @Accept json @Produce json @Success 200 {array} models.Account @Router /v1/accounts [get]

func RenewTokens

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 UpdateAccount

func UpdateAccount(c *fiber.Ctx) error

UpdateAccount func for updates account by given ID. @Description Update account. @Summary update account @Tags Account @Accept json @Produce json @Param id body string true "Account ID" @Param title body string true "Title" @Param author body string true "Author" @Param user_id body string true "User ID" @Param account_status body integer true "Account status" @Param account_attrs body models.AccountAttrs true "Account attributes" @Success 202 {string} status "ok" @Security ApiKeyAuth @Router /v1/account [put]

func UserSignIn

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

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

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