helpers

package
v0.0.0-...-76f2794 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func GenerateToken

func GenerateToken(userID uuid.UUID, userRoles []domain.UserRole, claimsParam ShouldClaims) (generatedToken string, err error)

func GenerateUUID

func GenerateUUID() string

func HashPassword

func HashPassword(password string) (string, error)

func SendEmail

func SendEmail(emailChan chan *Email) error

func Ternary

func Ternary[T comparable](value1, value2 T) T

Types

type Email

type Email struct {
	Recipient []string
	Body      interface{}
	Template  []byte
}

type JwtCustomClaims

type JwtCustomClaims struct {
	UserID uuid.UUID         `json:"id"`
	Roles  []domain.UserRole `json:"roles"`
	jwt.RegisteredClaims
}

type ShouldClaims

type ShouldClaims struct {
	ExpiresAt int64
	Secret    string
}

Jump to

Keyboard shortcuts

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