Documentation ¶
Index ¶
- Constants
- func ContainsAny(str string, chars []string) bool
- func ContainsNumbers(str string) bool
- func ContainsSpecialCharacters(str string) bool
- func CreateDir(path string) error
- func CurrentDate() string
- func DecryptToken(token string, secret string) (*jwt.Token, *apimodels.Error)
- func EncryptSha256(text string) string
- func ExistsDir(path string) bool
- func GenerateAuthToken(user *usersmodels.User, device *devicemodels.Device, secret string) (string, *apimodels.Error)
- func GenerateOTP(length int) (string, *apimodels.Error)
- func GenerateValidationCode(text string) (string, *apimodels.Error)
- func GetCurrentMillis() int64
- func GetProfilePicturePath(username string, path string) string
- func Int2String(num int) string
- func Int642String(num int64) string
- func IsEmpty(str string) bool
- func IsLowerCase(str string) bool
- func IsUpperCase(str string) bool
- func ParseJson[T interface{}](body io.Reader, object *T) error
- func Ping() string
- func ReadFile(filepath string) ([]byte, error)
- func SaveFile(filepath string, content []byte) error
- func StringToObjectId(str string) (primitive.ObjectID, error)
- func ValidateDescription(description string) *apimodels.Error
- func ValidateEmail(email string) *apimodels.Error
- func ValidateName(name string) *apimodels.Error
- func ValidatePassword(password string) *apimodels.Error
- func ValueOrEmpty(str string) *string
Constants ¶
const DEFAULT_PROFILE_PICTURE_EXTENSION = ".jpg"
const MINIMUM_CHARACTERS_FOR_EMAIL = 5
const MINIMUM_CHARACTERS_FOR_PASSWORD = 16
const OTP_CHARS = "1234567890"
Variables ¶
This section is empty.
Functions ¶
func ContainsAny ¶
ContainsAny returns true if the string contains any of the chars
[param] str | string: string to check [param] chars | []string: chars to check
[return] bool: true if the string contains any of the chars
func ContainsNumbers ¶
ContainsNumbers returns true if the string contains any number
[param] str | string: string to check
[return] bool: true if the string contains any number
func ContainsSpecialCharacters ¶
ContainsSpecialCharacters returns true if the string contains any special character
[param] str | string: string to check
[return] bool: true if the string contains any special character
func CurrentDate ¶
func CurrentDate() string
func EncryptSha256 ¶
func GenerateAuthToken ¶
func GenerateAuthToken(user *usersmodels.User, device *devicemodels.Device, secret string) (string, *apimodels.Error)
func GetCurrentMillis ¶ added in v0.0.13
func GetCurrentMillis() int64
func GetProfilePicturePath ¶
func Int2String ¶
Convert int to string
[param] num | int: number to convert
[return] string: converted number
func Int642String ¶
Convert Int64 to String
[param] num | int64: number to convert
[return] string: converted number
func IsEmpty ¶
IsEmpty returns true if the string is empty
[param] str | string: string to check
[return] bool: true if the string is empty
func IsLowerCase ¶
IsLowerCase returns true if the string is lowercase
[param] str | string: string to check
[return] bool: true if the string is lowercase
func IsUpperCase ¶
IsUpperCase returns true if the string is uppercase
[param] str | string: string to check
[return] bool: true if the string is uppercase
func StringToObjectId ¶
StringToObjectId converts a string to a primitive.ObjectID
[param] str | string: string to convert
[return] primitive.ObjectID: converted string
func ValidateDescription ¶
func ValidateEmail ¶
func ValidateName ¶
func ValidatePassword ¶
func ValueOrEmpty ¶
Get string pointer from string or nil if empty
[param] str | string: string to convert
[return] *string: string pointer
Types ¶
This section is empty.