utils

package
v0.0.0-...-ee28949 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePasswords

func ComparePasswords(hashedPassword string, password string) error

func GenerateToken

func GenerateToken(userId uint, email string, secretKey string) (string, error)

func HandleGenericResponse

func HandleGenericResponse(w http.ResponseWriter, message string, statusCode int)

func HashPassword

func HashPassword(password string) (string, error)

func ValidateToken

func ValidateToken(tokenString string, secretKey string) (jwt.MapClaims, error)

Types

type GenericResponse

type GenericResponse struct {
	Status  int         `json:"status"`
	Message string      `json:"message"`
	Payload interface{} `json:"payload"`
}

func NewGenericResponse

func NewGenericResponse(status int, message string, payload interface{}) *GenericResponse

Jump to

Keyboard shortcuts

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