utils

package
v0.0.0-...-077e497 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utils containing utilities function

This package cannot have import from another package except for config package

Package utils containing utilities function

This package cannot have import from another package except for config package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(hp string, p string) error

ComparePassword compare hashed password and inputed password

func GenerateJWT

func GenerateJWT(email string, role string) (string, error)

GenerateJWT generate jwt token string

func HashPassword

func HashPassword(p string) (string, error)

HashPassword hashing password

func ValidateJWT

func ValidateJWT(tokenString string) map[string]string

ValidateJWT validate jwt token string

If token not valid, return nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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