utils

package
v0.0.0-...-b9d1559 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ForgetMessage = `` /* 591-byte string literal not displayed */
View Source
var VerifyMessage = `` /* 578-byte string literal not displayed */

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, r *http.Request)

func DatabaseConnection

func DatabaseConnection(host, port, user, dbname, password, sslmode string) (*sql.DB, error)

func GeneralStatus

func GeneralStatus(w http.ResponseWriter, r *http.Request, code int)

func InternalServerError

func InternalServerError(w http.ResponseWriter, r *http.Request)

func IsEmpty

func IsEmpty(username, email, firstName, lastName, password, phoneNumber string) error

func LoggerFile

func LoggerFile() (*os.File, error)

func MethodNotAllowed

func MethodNotAllowed(w http.ResponseWriter, r *http.Request)

func NewMail

func NewMail(receiver, subject, message, username, token string) error

func Notfound

func Notfound(w http.ResponseWriter, r *http.Request)

func ProductEmpty

func ProductEmpty(name, category string, price float64, description string) error

func RediStore

func RediStore(size int, network string, host string, port string, password string, secretKey []byte) (*redistore.RediStore, error)

func StatusOk

func StatusOk(w http.ResponseWriter, r *http.Request)

func UnAuthorized

func UnAuthorized(w http.ResponseWriter, r *http.Request)

func ValidateEmail

func ValidateEmail(email string) (*string, error)

func ValidateFirstName

func ValidateFirstName(firstName string) (*string, error)

func ValidateLastName

func ValidateLastName(lastName string) (*string, error)

func ValidatePassword

func ValidatePassword(password string) (*string, error)

func ValidatePhone

func ValidatePhone(phone string) (*string, error)

func ValidateUsername

func ValidateUsername(username string) (*string, error)

Types

type Logger

type Logger struct {
	InfoLog    *log.Logger
	ErrorLog   *log.Logger
	WarningLog *log.Logger
}

func NewLogger

func NewLogger() *Logger

type Mail

type Mail struct {
	// contains filtered or unexported fields
}

func NewMailStruct

func NewMailStruct() *Mail

func NewMessage

func NewMessage(receiver, subject, message, username, token string) (*Mail, *gomail.Message)

Jump to

Keyboard shortcuts

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