utils

package
v0.0.0-...-39e08ed Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPasswordIsEmpty    = fmt.Errorf("the password is empty")
	ErrPasswordIsTooShort = fmt.Errorf("the password is too short")
)

Functions

func GenRandomBytes

func GenRandomBytes(size int) (blk []byte, err error)

func HashPassword

func HashPassword(password string) (string, error)

func InStringArray

func InStringArray(val string, array []string) (ok bool)

func IsCollectionExists

func IsCollectionExists(ctx context.Context, db *mongo.Database, collectionName string) (bool, error)

func PrepareErrorMessage

func PrepareErrorMessage(msg models.BaseMessage, errorType string, errorText string, serverID string) models.BaseMessage

func PrepareMessageInternalServerError

func PrepareMessageInternalServerError(msg models.BaseMessage, err error, serverID string) models.BaseMessage

func PrepareMessageUnauthorized

func PrepareMessageUnauthorized(msg models.BaseMessage, serverDomain string) models.BaseMessage

func ValidatePassword

func ValidatePassword(password string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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