utils

package
v0.0.0-...-f1d9a45 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(ttl time.Duration, payload interface{}, privateKey string) (string, error)

func Decode

func Decode(s string) (string, error)

func Encode

func Encode(s string) string

func HashPassword

func HashPassword(password string) (string, error)

func ParseTemplateDir

func ParseTemplateDir(dir string) (*template.Template, error)

func SendEmail

func SendEmail(user *models.DBResponse, data *EmailData, templateName string) error

func ToDoc

func ToDoc(v interface{}) (doc *bson.D, err error)

func ValidateToken

func ValidateToken(token string, publicKey string) (interface{}, error)

func VerifyPassword

func VerifyPassword(hashedPassword string, candidatePassword string) error

Types

type EmailData

type EmailData struct {
	URL       string
	FirstName string
	Subject   string
}

Jump to

Keyboard shortcuts

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