service

package
v1.0.2-a Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDigitMissing = errors.New("Digit missing in password")
View Source
var ErrInvalidEmail = errors.New("Invalid email")

Email validation Errros

View Source
var ErrInvalidPasswordLength = errors.New("Invalid password length")

Password validation Errros

View Source
var ErrLowercaseMissing = errors.New("Lowercase letter missing in password")
View Source
var ErrSpecialMissing = errors.New("Special character missing in password")
View Source
var ErrUppercaseMissing = errors.New("Uppercase letter missing in password")

Functions

func CompareHash

func CompareHash(password string, hash string) bool

func ConverEmailToSafeEmail

func ConverEmailToSafeEmail(email string) (string, error)

func CreateHash

func CreateHash(password string) (string, error)

func GenerateRandomString

func GenerateRandomString(length int) string

func ValidateEmail

func ValidateEmail(email string) error

func ValidatePassword

func ValidatePassword(password string) (bool, []error)

Types

type EmailClient

type EmailClient struct {
	Authentication smtp.Auth
	Address        string
	From           string
}
var Client *EmailClient

func Create

func Create(config *EmailConfig) *EmailClient

func (*EmailClient) SendEmail

func (config *EmailClient) SendEmail(to []string, msg string) error

type EmailConfig

type EmailConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	From     string
}

Jump to

Keyboard shortcuts

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