utils

package
v0.0.0-...-095c751 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrTooShort         = "Password is too short"
	ErrTooLong          = "Password is too long"
	ErrWrongFormat      = "Password does not contain required symbols"
	ErrWrongEmailFormat = "Wrong email format"
)

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password, hash string) bool

func DecodeImage

func DecodeImage(filename string) (string, error)

func DecodeImageWithScaling

func DecodeImageWithScaling(filename string) (string, error)

func FindIntersection

func FindIntersection(arr1, arr2 []string) []string

func HashPassword

func HashPassword(password string) string

func LoadEnv

func LoadEnv()

func RandString

func RandString(length int) string

func ScaleImage

func ScaleImage(file *os.File) (image.Image, error)

func ScheduledUpdate

func ScheduledUpdate(ctx context.Context, pool *pgxpool.Pool, metrics *mymetrics.DatabaseMetrics) error

func Validate

func Validate(email, password string) []string

func ValidateEmail

func ValidateEmail(email string) error

func WriteFile

func WriteFile(file *multipart.FileHeader, folderName string) (string, error)

func WriteResizedFile

func WriteResizedFile(file *multipart.FileHeader, folderName string) (string, error)

func YuKassaUpdates

func YuKassaUpdates() (*models.PaymentList, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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