helpers

package
v0.0.0-...-9fe57bb Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtoUint64

func AtoUint64(s string) uint64

AtoUint64 converts string to uint64

func CheckNewPassword

func CheckNewPassword(password string) error

CheckNewPassword checks if password is safe

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash checks if password has a specified hash

func CreatePasswordHash

func CreatePasswordHash(password string) string

CreatePasswordHash creates crypto hash of the password

func CreateSecureToken

func CreateSecureToken() string

CreateSecureToken creates new token for user activation / password recovery

func FileBasename

func FileBasename(s string) string

FileBasename returns base file name (without extension)

func GetUniqueFilename

func GetUniqueFilename(dir string, fname string) (string, error)

GetUniqueFilename checks if file exists and attempts to find a unique name by appendind _num to original name

func NormalizeEmail

func NormalizeEmail(email string) string

NormalizeEmail strips spaces and converts to lower case

func NotFoundOrOwned

func NotFoundOrOwned(entity string) string

NotFoundOrOwned returns error description when record of type %entity% is not found or not owned by the current user

func NotFoundOrOwnedError

func NotFoundOrOwnedError(entity string) error

NotFoundOrOwnedError returns NotFoundOrOwned message wrapped in error

func Substr

func Substr(s string, pos, length int) string

Substr returns substring of specified length

Types

This section is empty.

Jump to

Keyboard shortcuts

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