handler

package
v0.0.0-...-baa3690 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmailSend

func EmailSend(msg, to string) error

func EmailVerify

func EmailVerify(c *fiber.Ctx) error

func GenerateToken

func GenerateToken(claims *jwt.StandardClaims) (token string, err error)

func GoogleCallback

func GoogleCallback(c *fiber.Ctx) error

func GoogleLogin

func GoogleLogin(c *fiber.Ctx) error

func NewResetPasswordEmailMessage

func NewResetPasswordEmailMessage(to, token string) (msg string)

func NewVerificationEmailMessage

func NewVerificationEmailMessage(to, token string) (msg string)

return verification email message body with token

func ParseJwtToken

func ParseJwtToken(c *fiber.Ctx, token string) (*jwt.StandardClaims, error)

parse jwt token and return standard claims

func SetUserCookie

func SetUserCookie(c *fiber.Ctx, user *models.User) error

func UserCreate

func UserCreate(c *fiber.Ctx) error

UserCreate creates a new user account

@Summary		Create user
@Description	Create new user account
@Tags			User
@Accept			json
@Produce		json
@Param			User 	body		models.UserInfo	true	"User info"
@Success		200	{object}	models.User
@Failure		400	{object}	error
@Router			/user [post]

func UserDelete

func UserDelete(c *fiber.Ctx) error

UserDelete deletes a user account

@Summary		Delete user
@Description	Delete user account
@Tags			User
@Accept			json
@Produce		json
@Success		200	{object}	models.User
@Failure		400	{object}	error
@Security		ApiKeyAuth
@Router			/user [delete]

func UserGet

func UserGet(c *fiber.Ctx) error

UserGet get a user account

@Summary       Get user
@Description	Get user account
@Tags			User
@Accept			json
@Produce		json
@Param			id 	path		int	true	"User ID"
@Success		200	{object}	models.User
@Failure		400	{object}	error
@Router			/user/{id} [get]

func UserLogin

func UserLogin(c *fiber.Ctx) error

Login get user and password

func UserLogout

func UserLogout(c *fiber.Ctx) error

UserLogout logout user

func UserPasswordReset

func UserPasswordReset(c *fiber.Ctx) error

func UserUpdate

func UserUpdate(c *fiber.Ctx) error

UserUpdate updates a user account info

@Summary		Update user account info
@Description	Update user account info
@Tags			User
@Accept			json
@Produce		json
@Success		200	{object}	models.User
@Failure		400	{object}	error
@Param			id	path		int	true	"User ID"
@Param			User	body		models.UserInfo	true	"User"
@Security		ApiKeyAuth
@Router			/user/{id} [put]

Types

This section is empty.

Jump to

Keyboard shortcuts

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