utils

package
v0.0.0-...-54ca9e8 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Err_InvalidToken            = errors.New("invalid token")
	Err_UserIdMissing           = errors.New("userid is missing in the token")
	Err_UnexpectedSigningMethod = errors.New("unexpected signing method")
)

Functions

func ComparePassword

func ComparePassword(input string, password string) error

func CreateJWTToken

func CreateJWTToken(userID string) (string, error)

Create a JWT token with a given user ID and expiration time

func GenerateHashForPassword

func GenerateHashForPassword(input string) (string, error)

func GenerateShortURL

func GenerateShortURL() string

func GenerateUUID

func GenerateUUID() string

func GetCurrentTimestamp

func GetCurrentTimestamp() int64

func OneHourInSeconds

func OneHourInSeconds() int64

func OneWeekFromNow

func OneWeekFromNow() int64

func VerifyJWTToken

func VerifyJWTToken(tokenString string) (string, error)

Verify a JWT token and extract the user ID

Types

This section is empty.

Jump to

Keyboard shortcuts

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