utils

package
v0.0.0-...-5217b34 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(user *models.User, ExpiresAt int64) (string, error)

CreateToken create a jwt token depending to the user's id

func ExtractClaims

func ExtractClaims(token string) (*models.Claims, error)

ExtractClaims from the header and return it

func SendLoginResponse

func SendLoginResponse(c *gin.Context, code int, response *models.LoginResponsePayload)

SendLoginResponse is used to respond to the client

func SendMail

func SendMail(user *models.User, formMail interface{}, pathTotemplate string)

SendMail is used to send an email

func SendRegisterResponse

func SendRegisterResponse(c *gin.Context, code int, response *models.RegisterResponsePayload)

SendRegisterResponse is used to respond to the client

func SendResponse

func SendResponse(c *gin.Context, code int, response *models.ResponsePayload)

SendResponse is used to respond to the client

Types

This section is empty.

Jump to

Keyboard shortcuts

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