Documentation ¶
Index ¶
- Variables
- func CleanAllRepeatSpaces(v string) string
- func CompactString(a any) string
- func CompressWithDeflate(a any) ([]byte, error)
- func CompressWithGzip(a any) ([]byte, error)
- func CompressWithGzipToBase64(a any) (string, error)
- func Contains(a, b any, c ...any) bool
- func ContainsIgnoreCase(a, b any, c ...any) bool
- func ConvertByteUnitStrToFloat(a any) (float64, error)
- func ConvertFileToBytes(file *os.File) ([]byte, error)
- func ConvertMegaByteUnitStrToFloat(a any) (float64, error)
- func ConvertPointerToValue[T any](t *T) T
- func ConvertToBase64(a any) (string, error)
- func ConvertToBool(a any) (bool, error)
- func ConvertToBuffer(a any) (*bytes.Buffer, error)
- func ConvertToByteUnitStr(a any) string
- func ConvertToBytes(a any) ([]byte, error)
- func ConvertToDest(a, dest any) error
- func ConvertToFile(a any) (*os.File, error)
- func ConvertToFloat(a any) (float64, error)
- func ConvertToInt(a any) (int, error)
- func ConvertToMegaByteUnitStr(a any) string
- func ConvertToObjectId(a any) (primitive.ObjectID, error)
- func ConvertToPointer[T any](t T) *T
- func ConvertToPrimitiveDateTime(a any) (primitive.DateTime, error)
- func ConvertToReader(a any) (*bytes.Reader, error)
- func ConvertToString(a any) (string, error)
- func ConvertToTime(a any) (time.Time, error)
- func ConvertToTimeDuration(a any) (time.Duration, error)
- func DecompressFromBase64WithDeflate(a any) ([]byte, error)
- func DecompressFromBase64WithDeflateToDest(a, dest any) error
- func DecompressFromBase64WithGzip(a any) ([]byte, error)
- func DecompressFromBase64WithGzipToDest(a, dest any) error
- func DecompressWithDeflate(a any) ([]byte, error)
- func DecompressWithDeflateToDest(a, dest any) error
- func DecompressWithGzip(a any) ([]byte, error)
- func DecompressWithGzipToDest(a, dest any) error
- func Equals(a, b any, c ...any) bool
- func EqualsIgnoreCase(a, b any, c ...any) bool
- func EqualsLen(a any, len int) bool
- func FormatCnpj(v string) string
- func FormatCpf(v string) string
- func FormatEFloat32(v float32) string
- func FormatEFloat64(v float64) string
- func FormatFloat32(v float32) string
- func FormatFloat64(v float64) string
- func FormatMoney(v float64, precision int, symbol, thousand, decimal string) string
- func FormatMoneyBr(v float64) string
- func FormatPercentage(v float64, precision int) string
- func FormatPhoneNumber(v, defaultRegion string) string
- func FormatPhoneNumberNational(v, defaultRegion string) string
- func GetCallerInfo(skip int) (fileName string, line string, funcName string)
- func GetFileJson(uri string, dest any) error
- func GetFileString(uri string) (string, error)
- func GetFirstLastName(a any) string
- func HideCnpj(v string, maskStart bool) string
- func HideCpf(v string, maskStart bool) string
- func HideEmail(v string, maskStart bool) string
- func HidePhoneNumber(v, defaultRegion string, maskStart bool) string
- func HidePhoneNumberNational(v, defaultRegion string, maskStart bool) string
- func IfEmptyReturns[T any](a T, b T) T
- func IfNilReturns[T any](a *T, b T) T
- func IsAfter(a, b any) bool
- func IsAfterDate(a, b any) bool
- func IsAfterDateToday(a any) bool
- func IsAfterNow(a any) bool
- func IsAndroidDeviceId(a any) bool
- func IsBCrypt(a any) bool
- func IsBase64(a any) bool
- func IsBearer(a any) bool
- func IsBefore(a, b any) bool
- func IsBeforeDate(a, b any) bool
- func IsBeforeDateToday(a any) bool
- func IsBeforeNow(a any) bool
- func IsBirthDate(a any) bool
- func IsBool(a any) bool
- func IsBoolType(a any) bool
- func IsBufferType(a any) bool
- func IsByteUnit(a any) bool
- func IsBytesType(a any) bool
- func IsChanType(a any) bool
- func IsCnpj(a any) bool
- func IsCpf(a any) bool
- func IsCpfCnpj(a any) bool
- func IsEmail(a any) bool
- func IsEmpty(a any, b ...any) bool
- func IsErrorType(a any) bool
- func IsFileType(a any) bool
- func IsFloat(a any) bool
- func IsFloat32Type(a any) bool
- func IsFloat64Type(a any) bool
- func IsFloatType(a any) bool
- func IsFullName(a any) bool
- func IsFullNow(a any) bool
- func IsFuncType(a any) bool
- func IsGreaterThan(a, b any, c ...any) bool
- func IsGreaterThanOrEqual(a, b any, c ...any) bool
- func IsHttpMethod(a any) bool
- func IsIOSDeviceId(a any) bool
- func IsInt(a any) bool
- func IsInt16Type(a any) bool
- func IsInt32Type(a any) bool
- func IsInt64Type(a any) bool
- func IsInt8Type(a any) bool
- func IsIntType(a any) bool
- func IsInterfaceType(a any) bool
- func IsJson(a any) bool
- func IsJsonType(a any) bool
- func IsLessThan(a, b any, c ...any) bool
- func IsLessThanOrEqual(a, b any, c ...any) bool
- func IsLetter(a any) bool
- func IsMap(a any) bool
- func IsMapType(a any) bool
- func IsMegabyteUnit(a any) bool
- func IsMobilePlatform(a any) bool
- func IsNil(a any, b ...any) bool
- func IsNilOrEmpty(a any, b ...any) bool
- func IsNotAndroidDeviceId(a any) bool
- func IsNotBCrypt(a any) bool
- func IsNotBase64(a any) bool
- func IsNotBearer(a any) bool
- func IsNotBirthDate(a any) bool
- func IsNotBool(a any) bool
- func IsNotBoolType(a any) bool
- func IsNotBufferType(a any) bool
- func IsNotByteUnit(a any) bool
- func IsNotBytesType(a any) bool
- func IsNotChanType(a any) bool
- func IsNotCnpj(a any) bool
- func IsNotCpf(a any) bool
- func IsNotCpfCnpj(a any) bool
- func IsNotEmail(a any) bool
- func IsNotEmpty(a any, b ...any) bool
- func IsNotEqualTo(a, b any, c ...any) bool
- func IsNotEqualToIgnoreCase(a, b any, c ...any) bool
- func IsNotEqualsLen(a any, len int) bool
- func IsNotErrorType(a any) bool
- func IsNotFileType(a any) bool
- func IsNotFloat(a any) bool
- func IsNotFloat32Type(a any) bool
- func IsNotFloat64Type(a any) bool
- func IsNotFloatType(a any) bool
- func IsNotFullName(a any) bool
- func IsNotFuncType(a any) bool
- func IsNotHttpMethod(a any) bool
- func IsNotIOSDeviceId(a any) bool
- func IsNotInt(a any) bool
- func IsNotInt16Type(a any) bool
- func IsNotInt32Type(a any) bool
- func IsNotInt64Type(a any) bool
- func IsNotInt8Type(a any) bool
- func IsNotIntType(a any) bool
- func IsNotInterfaceType(a any) bool
- func IsNotJson(a any) bool
- func IsNotJsonType(a any) bool
- func IsNotMap(a any) bool
- func IsNotMapType(a any) bool
- func IsNotMegabyteUnit(a any) bool
- func IsNotMobilePlatform(a any) bool
- func IsNotNil(a any, b ...any) bool
- func IsNotNilAndNotEmpty(a any, b ...any) bool
- func IsNotObjectIdType(a any) bool
- func IsNotPhoneNumber(a any, defaultRegion string) bool
- func IsNotPointerType(a any) bool
- func IsNotPostalCode(a any) bool
- func IsNotPostalCodePerCountry(a any, countryIso string) bool
- func IsNotPrimitiveDateTimeType(a any) bool
- func IsNotPrivateIp(a any) bool
- func IsNotReaderType(a any) bool
- func IsNotSlice(a any) bool
- func IsNotSliceOfMaps(a any) bool
- func IsNotSliceOfMapsType(a any) bool
- func IsNotSliceType(a any) bool
- func IsNotStringType(a any) bool
- func IsNotStructType(a any) bool
- func IsNotTime(a any) bool
- func IsNotTimeDurationType(a any) bool
- func IsNotTimeType(a any) bool
- func IsNotUint16Type(a any) bool
- func IsNotUint32Type(a any) bool
- func IsNotUint64Type(a any) bool
- func IsNotUint8Type(a any) bool
- func IsNotUintType(a any) bool
- func IsNotUrl(a any) bool
- func IsNotUrlPath(a any) bool
- func IsNow(a any) bool
- func IsNumeric(a any) bool
- func IsObjectIdType(a any) bool
- func IsPhoneNumber(a any, defaultRegion string) bool
- func IsPointerType(a any) bool
- func IsPostalCode(a any) bool
- func IsPostalCodePerCountry(a any, countryIso string) bool
- func IsPrimitiveDateTimeType(a any) bool
- func IsPrivateIp(a any) bool
- func IsReaderType(a any) bool
- func IsSlice(a any) bool
- func IsSliceOfMaps(a any) bool
- func IsSliceOfMapsType(a any) bool
- func IsSliceType(a any) bool
- func IsStringType(a any) bool
- func IsStructType(a any) bool
- func IsTime(a any) bool
- func IsTimeDurationType(a any) bool
- func IsTimeType(a any) bool
- func IsToday(a any) bool
- func IsUint16Type(a any) bool
- func IsUint32Type(a any) bool
- func IsUint64Type(a any) bool
- func IsUint8Type(a any) bool
- func IsUintType(a any) bool
- func IsUrl(a any) bool
- func IsUrlPath(a any) bool
- func Len(a any) int
- func MaskStartOrEndOfString(s string, mask rune, maskStart bool) string
- func MaxFloat32(v, max float32) float32
- func MaxFloat64(v, max float64) float64
- func MaxInt(v, max int) int
- func MaxInt32(v, max int32) int32
- func MaxInt64(v, max int64) int64
- func MinFloat32(v, min float32) float32
- func MinFloat64(v, min float64) float64
- func MinInt(v, min int) int
- func MinInt32(v, min int32) int32
- func MinInt64(v, min int64) int64
- func NotContains(a, b any, c ...any) bool
- func NotContainsIgnoreCase(a, b any, c ...any) bool
- func RandomBool() bool
- func RandomNumber(min, max int) int
- func RandomNumberStr(min, max int) string
- func ReturnNonEmptyValue[T any](a ...T) T
- func ReturnNonNilValue[T any](a ...T) T
- func Round(v float64, precision int) float64
- func RoundDown(v float64, precision int) float64
- func RoundUp(v float64, precision int) float64
- func SimpleConvertByteUnitStrToFloat(a any) float64
- func SimpleConvertFileToBytes(file *os.File) []byte
- func SimpleConvertMegaByteUnitStrToFloat(a any) float64
- func SimpleConvertToBase64(a any) string
- func SimpleConvertToBool(a any) bool
- func SimpleConvertToBuffer(a any) *bytes.Buffer
- func SimpleConvertToBytes(a any) []byte
- func SimpleConvertToDest(a, dest any)
- func SimpleConvertToFile(a any) *os.File
- func SimpleConvertToFloat(a any) float64
- func SimpleConvertToInt(a any) int
- func SimpleConvertToObjectId(a any) primitive.ObjectID
- func SimpleConvertToPrimitiveDateTime(a any) primitive.DateTime
- func SimpleConvertToReader(a any) *bytes.Reader
- func SimpleConvertToString(a any) string
- func SimpleConvertToTime(a any) time.Time
- func SimpleConvertToTimeDuration(a any) time.Duration
- func Sprintln(a ...any) string
- func Validate() *validator.Validate
- type BaseEnum
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFormatByteUnit = errors.New("byte unit invalid format ex: 123.3MB")
var ErrInvalidFormatMegaByteUnit = errors.New("megabyte unit invalid format ex: 102.3MB")
Functions ¶
func CleanAllRepeatSpaces ¶
CleanAllRepeatSpaces clean all repeat space, ex: Get All Girls in the \n party -> Get All Girls in the party
func CompactString ¶ added in v1.7.0
CompactString compact string representation of a value. If the value is a valid JSON, it will be compacted to a single line of JSON string. Otherwise, it removes all repeated spaces from the string representation of the value.
func CompressWithDeflate ¶ added in v1.7.8
func CompressWithGzip ¶ added in v1.7.8
func CompressWithGzipToBase64 ¶ added in v1.7.8
func Contains ¶ added in v1.3.8
Contains if values passed in parameters B and C contain the value of parameter A, it returns true, otherwise it returns false
func ContainsIgnoreCase ¶ added in v1.3.8
ContainsIgnoreCase if values passed in parameters B and C contain the value of parameter A, it returns true, otherwise it returns false
func ConvertByteUnitStrToFloat ¶ added in v1.6.1
ConvertByteUnitStrToFloat convert byte unit text to int ex: 1KB = 1024.0
func ConvertFileToBytes ¶ added in v1.0.6
ConvertFileToBytes convert os.File value to slice byte
func ConvertMegaByteUnitStrToFloat ¶ added in v1.6.2
ConvertMegaByteUnitStrToFloat convert megabyte unit text to int ex: 1GB = 1024
func ConvertPointerToValue ¶ added in v1.0.7
func ConvertPointerToValue[T any](t *T) T
ConvertPointerToValue convert pointer value to value
func ConvertToBase64 ¶ added in v1.0.9
ConvertToBase64 convert any value to string base64
func ConvertToBool ¶ added in v1.0.2
ConvertToBool convert any value to float
func ConvertToBuffer ¶ added in v1.0.7
ConvertToBuffer convert any value to bytes.Buffer
func ConvertToByteUnitStr ¶ added in v1.6.1
ConvertToByteUnitStr takes an integer value in bytes and converts it to a human-readable byte unit string. If the value is less than 1024, it returns the value with the unit "B" appended. If the value is greater than or equal to 1024, it calculates the appropriate unit (KB, MB, GB, etc.) and returns the value with the corresponding unit appended. The value is rounded to one decimal place. This function does not handle negative values.
func ConvertToBytes ¶ added in v1.0.2
ConvertToBytes convert any value to bytes
func ConvertToDest ¶ added in v1.0.2
ConvertToDest convert value to dest param
func ConvertToFile ¶ added in v1.0.7
ConvertToFile convert any value to os.File .txt base64
func ConvertToFloat ¶ added in v1.0.2
ConvertToFloat convert any value to float
func ConvertToInt ¶ added in v1.0.2
ConvertToInt convert any value to int
func ConvertToMegaByteUnitStr ¶ added in v1.6.1
ConvertToMegaByteUnitStr converts an integer value to a string representation in megabyte units. It takes in a parameter `a` which can be of any type that can be converted to an integer. The function returns a string representation of the passed value in megabyte units. If the value is less than 1MB, it returns the value followed by the string "B" (e.g. "256B"). If the value is greater than or equal to 1MB, it converts the value to the nearest megabyte, appends the appropriate unit symbol (K, M, G, T, P, E, Z, Y) based on the magnitude of the value, and appends the string "B" at the end (e.g. "4.5MB", "10.2GB", "3.7TB", etc.).
func ConvertToObjectId ¶
ConvertToObjectId convert any value to primitive.ObjectID
func ConvertToPointer ¶
func ConvertToPointer[T any](t T) *T
ConvertToPointer convert any value to pointer
func ConvertToPrimitiveDateTime ¶ added in v1.1.7
ConvertToPrimitiveDateTime convert any value to primitive.DateTime
func ConvertToReader ¶ added in v1.0.7
ConvertToReader convert any value to io.Reader
func ConvertToString ¶
ConvertToString convert any value to beautiful string
func ConvertToTime ¶
ConvertToTime convert any value to time
func ConvertToTimeDuration ¶ added in v1.6.7
ConvertToTimeDuration convert any value to time duration
func DecompressFromBase64WithDeflate ¶ added in v1.7.8
func DecompressFromBase64WithDeflateToDest ¶ added in v1.7.9
func DecompressFromBase64WithGzip ¶ added in v1.7.8
func DecompressFromBase64WithGzipToDest ¶ added in v1.7.9
func DecompressWithDeflate ¶ added in v1.7.8
func DecompressWithDeflateToDest ¶ added in v1.7.9
func DecompressWithGzip ¶ added in v1.7.8
func DecompressWithGzipToDest ¶ added in v1.7.9
func Equals ¶ added in v1.2.9
Equals compare values if are equals return true, otherwise return false
func EqualsIgnoreCase ¶ added in v1.2.9
EqualsIgnoreCase compare values if are equals ignoring case return true, otherwise return false
func EqualsLen ¶ added in v1.4.0
EqualsLen compares whether the size of the value of parameter A is equal to the suggested len parameter.
func FormatCnpj ¶
FormatCnpj format string to cnpj if valid ex: 45991590000108 -> 45.991.590/0001-08
func FormatEFloat32 ¶
FormatEFloat32 format float64 to string ex: 3.1415926535 -> "3.1415927E+00"
func FormatEFloat64 ¶
FormatEFloat64 format float64 to string ex: 3.1415926535 -> "3.1415926535E+00"
func FormatFloat32 ¶
FormatFloat32 format float32 to string ex: 3.1415926535 -> "3.1415926535"
func FormatFloat64 ¶
FormatFloat64 format float64 to string ex: 3.1415926535 -> "3.1415926535"
func FormatMoney ¶
FormatMoney format float to string money
Usage:
result := FormatMoney(12.23, 2, "R$" , ".", "," )
log.Println("money result:", result)
Output:
[INFO 2023/12/24 08:26:38] money result: R$ 12,23
func FormatMoneyBr ¶ added in v1.4.3
FormatMoneyBr format float to string money
Usage:
result := FormatMoneyBr(12.23)
log.Println("money result:", result)
Output:
[INFO 2023/12/24 08:26:38] money result: R$ 12,23
func FormatPercentage ¶
FormatPercentage format float to string percentage ex: 12.23 -> "12,23%"
func FormatPhoneNumber ¶
FormatPhoneNumber format string to international phone number if valid value string ex: 47997576130 -> +55 47 99757-6130
func FormatPhoneNumberNational ¶
FormatPhoneNumberNational format string to national phone number ex: 47997576130 -> 47 99757-6130
func GetCallerInfo ¶ added in v1.1.8
func GetFileJson ¶
GetFileJson get file by uri string param, fill dest by file json
func GetFileString ¶
GetFileString get file by uri string param
func GetFirstLastName ¶
GetFirstLastName get first and last name by string value or string pointer, ex: Gabriel Henrique Cataldo -> Gabriel Cataldo.
func HideCnpj ¶
HideCnpj formats and partially hides the value ex: 45991590000108 to 45.991.590/****-**
func HideEmail ¶
HideEmail partially hide the value email if it is a valid if maskStart param is true
ex: gabrielcataldo@gmail.com to ***********do@gmail.com
if masStart param is false (default)
ex: gabrielcataldo@gmail.com to gabrielcatal**@*****.***
func HidePhoneNumber ¶
HidePhoneNumber international format of the phone number and partially hide the value if it is a valid phone number ex: 47997576130 to +55 47 99757-****
func HidePhoneNumberNational ¶
HidePhoneNumberNational national format of the phone number and partially hide the value if it is a valid phone number ex: 47997576130 to 47 99757-****
func IfEmptyReturns ¶ added in v1.3.0
func IfEmptyReturns[T any](a T, b T) T
IfEmptyReturns if A is empty return B value, otherwise return A value
func IfNilReturns ¶ added in v1.3.0
func IfNilReturns[T any](a *T, b T) T
IfNilReturns if A is nil return value B, otherwise return A value
func IsAfter ¶
IsAfter If parameter A is after parameter B it will return true, otherwise it will return false.
func IsAfterDate ¶
IsAfterDate If parameter A has a date after the date of parameter B, it returns true, otherwise it will return false.
func IsAfterDateToday ¶
IsAfterDateToday If the parameter entered is after today it will return true, otherwise it will return false
func IsAfterNow ¶
IsAfterNow if the parameter entered was after now it will return true, otherwise it will return false
func IsAndroidDeviceId ¶ added in v1.0.9
IsAndroidDeviceId If value string is android device id hex return true, otherwise return false
func IsBefore ¶
IsBefore If parameter A is before parameter B it will return true, otherwise it will return false.
func IsBeforeDate ¶
IsBeforeDate If parameter A has a date before the date of parameter B, it returns true, otherwise it will return false.
func IsBeforeDateToday ¶
IsBeforeDateToday If the parameter entered is before today it will return true, otherwise it will return false
func IsBeforeNow ¶
IsBeforeNow if the parameter entered was before now it will return true, otherwise it will return false
func IsBirthDate ¶ added in v1.0.9
IsBirthDate If value time is before today return true, otherwise return false
func IsBoolType ¶ added in v1.6.5
IsBoolType If value is bool return true, otherwise return false
func IsBufferType ¶ added in v1.6.5
IsBufferType If value is bytes.Buffer return true, otherwise return false
func IsByteUnit ¶ added in v1.6.7
IsByteUnit check if value is string byte unit (ex: "12MB") return true, otherwise return false.
func IsBytesType ¶ added in v1.6.5
IsBytesType If value is slice byte return true, otherwise return false
func IsChanType ¶ added in v1.6.5
IsChanType If value is chan return true, otherwise return false
func IsCpfCnpj ¶ added in v1.0.9
IsCpfCnpj If value is cpf or cnpj return true, otherwise return false
func IsErrorType ¶ added in v1.6.5
IsErrorType If value is error return true, otherwise return false
func IsFileType ¶ added in v1.6.5
IsFileType If value is os.File return true, otherwise return false
func IsFloat32Type ¶ added in v1.6.5
IsFloat32Type If value is float32 return true, otherwise return false
func IsFloat64Type ¶ added in v1.6.5
IsFloat64Type If value is float64 return true, otherwise return false
func IsFloatType ¶ added in v1.6.5
IsFloatType If value is float32 or float64 return true, otherwise return false
func IsFullName ¶ added in v1.0.9
IsFullName If value contains first name and last name return true, otherwise return false
func IsFullNow ¶
IsFullNow If the parameter entered is now it will return true, otherwise it will return false
func IsFuncType ¶ added in v1.6.5
IsFuncType If value is func return true, otherwise return false
func IsGreaterThan ¶ added in v1.2.8
IsGreaterThan compares whether A is greater than all values passed in other parameters, if the value is not numeric, let's use the Len function and compare the size
func IsGreaterThanOrEqual ¶ added in v1.2.8
IsGreaterThanOrEqual compares whether A is greater than or equal to all values passed in others params, If the value is not numeric, let's use the Len function and compare the size
func IsHttpMethod ¶ added in v1.7.1
IsHttpMethod checks whether the given value represents a valid HTTP method. It converts the value to a string and compares it with predefined HTTP method constants. Returns true if the value is a valid HTTP method, otherwise returns false.
func IsIOSDeviceId ¶ added in v1.1.0
IsIOSDeviceId If value string is ios device id hex return true, otherwise return false
func IsInt16Type ¶ added in v1.6.5
IsInt16Type If value is int16 return true, otherwise return false
func IsInt32Type ¶ added in v1.6.5
IsInt32Type If value is int32 return true, otherwise return false
func IsInt64Type ¶ added in v1.6.5
IsInt64Type If value is int64 return true, otherwise return false
func IsInt8Type ¶ added in v1.6.5
IsInt8Type If value is int8 return true, otherwise return false
func IsIntType ¶ added in v1.6.5
IsIntType If value is int, int8, int16, int32 or int64 return true, otherwise return false
func IsInterfaceType ¶ added in v1.6.5
IsInterfaceType If value is interface return true, otherwise return false
func IsJsonType ¶ added in v1.6.5
IsJsonType If value is struct, map, slice or array return true, otherwise return false
func IsLessThan ¶ added in v1.2.8
IsLessThan compares whether A is less than all values passed in others params, If the value is not numeric, let's use the Len function and compare the size
func IsLessThanOrEqual ¶ added in v1.2.8
IsLessThanOrEqual compares whether A is less than or equal to all values passed in others params, If the value is not numeric, let's use the Len function and compare the size
func IsLetter ¶
IsLetter check any value is letter, ex: v any is int return false, if string letter return true, if bool return true.
func IsMegabyteUnit ¶ added in v1.6.7
IsMegabyteUnit check if value is string megabyte unit (ex: "12TB") return true, otherwise return false.
func IsMobilePlatform ¶ added in v1.0.9
IsMobilePlatform If value string is "android", "ios" or "iphone os" (independently we always count lowercase) return true, otherwise return false
func IsNilOrEmpty ¶ added in v1.7.7
func IsNotAndroidDeviceId ¶ added in v1.0.9
IsNotAndroidDeviceId If value string is not android device id hex return true, otherwise return false
func IsNotBCrypt ¶ added in v1.0.9
IsNotBCrypt If value is not string bcrypt return true, otherwise return false
func IsNotBase64 ¶ added in v1.0.9
IsNotBase64 If value is not string base64 return true, otherwise return false
func IsNotBearer ¶ added in v1.0.9
IsNotBearer If value is not string bearer return true, otherwise return false
func IsNotBirthDate ¶ added in v1.0.9
IsNotBirthDate If value time is before today return true, otherwise return false
func IsNotBool ¶ added in v1.0.2
IsNotBool check if value is not bool return true, otherwise return false.
func IsNotBoolType ¶ added in v1.6.5
IsNotBoolType If value is not bool return true, otherwise return false
func IsNotBufferType ¶ added in v1.6.5
IsNotBufferType If value is bytes.Buffer return true, otherwise return false
func IsNotByteUnit ¶ added in v1.6.7
IsNotByteUnit check if value is not string byte unit (ex: "12MB") return true, otherwise return false.
func IsNotBytesType ¶ added in v1.6.5
IsNotBytesType If value is not slice byte return true, otherwise return false
func IsNotChanType ¶ added in v1.6.5
IsNotChanType If value is not chan return true, otherwise return false
func IsNotCpfCnpj ¶ added in v1.0.9
IsNotCpfCnpj If value is not cpf or cnpj return true, otherwise return false
func IsNotEmail ¶ added in v1.0.9
IsNotEmail If value is not email return true, otherwise return false
func IsNotEqualTo ¶ added in v1.2.9
IsNotEqualTo compare values if aren't equals return true, otherwise return false
func IsNotEqualToIgnoreCase ¶ added in v1.2.9
IsNotEqualToIgnoreCase compare values if aren't equals ignoring case return true, otherwise return false
func IsNotEqualsLen ¶ added in v1.4.0
IsNotEqualsLen compares whether the size of the value of parameter A is not equal to the suggested len parameter.
func IsNotErrorType ¶ added in v1.6.5
IsNotErrorType If value is not error return true, otherwise return false
func IsNotFileType ¶ added in v1.6.5
IsNotFileType If value is os.File return true, otherwise return false
func IsNotFloat ¶ added in v1.0.2
IsNotFloat check if value is not float return true, otherwise return false.
func IsNotFloat32Type ¶ added in v1.6.5
IsNotFloat32Type If value is not float32 return true, otherwise return false
func IsNotFloat64Type ¶ added in v1.6.5
IsNotFloat64Type If value is not float64 return true, otherwise return false
func IsNotFloatType ¶ added in v1.6.5
IsNotFloatType If value is not float32 or float64 return true, otherwise return false
func IsNotFullName ¶ added in v1.0.9
IsNotFullName If value not contains first name and last name return true, otherwise return false
func IsNotFuncType ¶ added in v1.6.5
IsNotFuncType If value is not func return true, otherwise return false
func IsNotHttpMethod ¶ added in v1.7.1
IsNotHttpMethod checks whether the given value is not a valid HTTP method. It negates the result of the IsHttpMethod function. Returns true if the value is not a valid HTTP method, otherwise returns false.
func IsNotIOSDeviceId ¶ added in v1.0.9
IsNotIOSDeviceId If value string is not ios device id hex return true, otherwise return false
func IsNotInt ¶ added in v1.0.2
IsNotInt check if value is not int return true, otherwise return false.
func IsNotInt16Type ¶ added in v1.6.5
IsNotInt16Type If value is not int16 return true, otherwise return false
func IsNotInt32Type ¶ added in v1.6.5
IsNotInt32Type If value is not int32 return true, otherwise return false
func IsNotInt64Type ¶ added in v1.6.5
IsNotInt64Type If value is not int64 return true, otherwise return false
func IsNotInt8Type ¶ added in v1.6.5
IsNotInt8Type If value is not int8 return true, otherwise return false
func IsNotIntType ¶ added in v1.6.5
IsNotIntType If value is not int, int8, int16, int32 or int64 return true, otherwise return false
func IsNotInterfaceType ¶ added in v1.6.5
IsNotInterfaceType If value is interface return true, otherwise return false
func IsNotJson ¶ added in v1.0.2
IsNotJson check if value is not json return true, otherwise return false.
func IsNotJsonType ¶ added in v1.6.5
IsNotJsonType If value is not struct, map, slice or array return true, otherwise return false
func IsNotMap ¶ added in v1.0.2
IsNotMap check if value is not map return true, otherwise return false.
func IsNotMapType ¶ added in v1.6.5
IsNotMapType If value is not map return true, otherwise return false
func IsNotMegabyteUnit ¶ added in v1.6.7
IsNotMegabyteUnit check if value is not string megabyte unit (ex: "12MB") return true, otherwise return false.
func IsNotMobilePlatform ¶ added in v1.0.9
IsNotMobilePlatform If value string is not "android", "ios" or "iphone os" (independently we always count lowercase) return true, otherwise return false
func IsNotNilAndNotEmpty ¶ added in v1.7.7
func IsNotObjectIdType ¶ added in v1.6.5
IsNotObjectIdType If value is not primitive.ObjectID return true, otherwise return false
func IsNotPhoneNumber ¶ added in v1.0.9
IsNotPhoneNumber If value is not phone number by region return true, otherwise return false
func IsNotPointerType ¶ added in v1.6.5
IsNotPointerType If value is not pointer return true, otherwise return false
func IsNotPostalCode ¶ added in v1.0.9
IsNotPostalCode If value is not postal code return true, otherwise return false
func IsNotPostalCodePerCountry ¶ added in v1.0.9
IsNotPostalCodePerCountry If value is not postal code per country return true, otherwise return false
func IsNotPrimitiveDateTimeType ¶ added in v1.6.5
IsNotPrimitiveDateTimeType If value is not primitive.DateTime return true, otherwise return false
func IsNotPrivateIp ¶ added in v1.0.9
IsNotPrivateIp check value is private ip
func IsNotReaderType ¶ added in v1.6.5
IsNotReaderType If value is io.Reader return true, otherwise return false
func IsNotSlice ¶ added in v1.0.2
IsNotSlice check if value is not slice return true, otherwise return false.
func IsNotSliceOfMaps ¶ added in v1.6.5
IsNotSliceOfMaps check if value is not slice of maps return true, otherwise return false.
func IsNotSliceOfMapsType ¶ added in v1.6.6
IsNotSliceOfMapsType If value is not slice or array of maps return true, otherwise return false
func IsNotSliceType ¶ added in v1.6.5
IsNotSliceType If value is not slice or array return true, otherwise return false
func IsNotStringType ¶ added in v1.6.5
IsNotStringType If value is not string return true, otherwise return false
func IsNotStructType ¶ added in v1.6.5
IsNotStructType If value is not struct return true, otherwise return false
func IsNotTime ¶ added in v1.0.2
IsNotTime check if value is not time return true, otherwise return false.
func IsNotTimeDurationType ¶ added in v1.6.7
IsNotTimeDurationType If value is not time duration return true, otherwise return false
func IsNotTimeType ¶ added in v1.6.5
IsNotTimeType If value is not time return true, otherwise return false
func IsNotUint16Type ¶ added in v1.6.5
IsNotUint16Type If value is not uint16 return true, otherwise return false
func IsNotUint32Type ¶ added in v1.6.5
IsNotUint32Type If value is not uint32 return true, otherwise return false
func IsNotUint64Type ¶ added in v1.6.5
IsNotUint64Type If value is not uint64 return true, otherwise return false
func IsNotUint8Type ¶ added in v1.6.5
IsNotUint8Type If value is not uint8 return true, otherwise return false
func IsNotUintType ¶ added in v1.6.5
IsNotUintType If value is not uint, uint8, uint16, uint32 or uint64 return true, otherwise return false
func IsNotUrl ¶ added in v1.0.9
IsNotUrl If value is not url return true, otherwise return false ex: "google.com" = false
func IsNotUrlPath ¶ added in v1.6.7
IsNotUrlPath check any value is not url path
func IsNow ¶
IsNow If the parameter entered is now (not counting the nanosecond) it will return true, otherwise it will return false
func IsNumeric ¶
IsNumeric check any value is numeric, ex: v any is int return true, if string numeric return true, if bool return false.
func IsObjectIdType ¶ added in v1.6.5
IsObjectIdType If value is primitive.ObjectID return true, otherwise return false
func IsPhoneNumber ¶
IsPhoneNumber If value is phone number by region return true, otherwise return false
func IsPointerType ¶ added in v1.6.5
IsPointerType If value is pointer return true, otherwise return false
func IsPostalCode ¶
IsPostalCode If value is postal code return true, otherwise return false
func IsPostalCodePerCountry ¶
IsPostalCodePerCountry If value is postal code per country return true, otherwise return false
func IsPrimitiveDateTimeType ¶ added in v1.6.5
IsPrimitiveDateTimeType If value is primitive.DateTime return true, otherwise return false
func IsPrivateIp ¶ added in v1.0.9
IsPrivateIp check value is private ip
func IsReaderType ¶ added in v1.6.5
IsReaderType If value is io.Reader return true, otherwise return false
func IsSliceOfMaps ¶ added in v1.6.5
IsSliceOfMaps check if string value is slice of maps return true, otherwise return false.
func IsSliceOfMapsType ¶ added in v1.6.6
IsSliceOfMapsType If value is slice or array of maps return true, otherwise return false
func IsSliceType ¶ added in v1.6.5
IsSliceType If value is slice or array return true, otherwise return false
func IsStringType ¶ added in v1.6.5
IsStringType If value is string return true, otherwise return false
func IsStructType ¶ added in v1.6.5
IsStructType If value is struct return true, otherwise return false
func IsTimeDurationType ¶ added in v1.6.7
IsTimeDurationType If value is time duration return true, otherwise return false
func IsTimeType ¶ added in v1.6.5
IsTimeType If value is time return true, otherwise return false
func IsToday ¶
IsToday If the parameter entered is today it will return true, otherwise it will return false
func IsUint16Type ¶ added in v1.6.5
IsUint16Type If value is uint16 return true, otherwise return false
func IsUint32Type ¶ added in v1.6.5
IsUint32Type If value is uint32 return true, otherwise return false
func IsUint64Type ¶ added in v1.6.5
IsUint64Type If value is uint64 return true, otherwise return false
func IsUint8Type ¶ added in v1.6.5
IsUint8Type If value is uint8 return true, otherwise return false
func IsUintType ¶ added in v1.6.5
IsUintType If value is uint, uint8, uint16, uint32 or uint64 return true, otherwise return false
func Len ¶ added in v1.3.8
Len retrieves the size of the passed value, if it is not a slice, struct or map, the size of the parameter converted to a string is returned.
func MaskStartOrEndOfString ¶
MaskStartOrEndOfString mask start or end of string
Parameters ¶
- s: string value - mask: character to replace - maskStart: if true mask start value, otherwise mask end value
func MaxFloat32 ¶ added in v1.5.8
MaxFloat32 max float, if v is less than max, max will prevail
func MaxFloat64 ¶ added in v1.5.8
MaxFloat64 max float, if v is less than max, max will prevail
func MinFloat32 ¶ added in v1.5.8
MinFloat32 min float, if v is greater than min, min will prevail
func MinFloat64 ¶ added in v1.5.8
MinFloat64 min float, if v is greater than min, min will prevail
func NotContains ¶ added in v1.3.8
NotContains if values passed in parameters B and C do not contain the value of parameter A, it returns true, otherwise it returns false
func NotContainsIgnoreCase ¶ added in v1.3.8
NotContainsIgnoreCase if values passed in parameters B and C do not contain the value of parameter A, it returns true, otherwise it returns false
func RandomNumber ¶
RandomNumber random number generator with range min and max
func RandomNumberStr ¶
RandomNumberStr generate random numbers string by min and max parameters
func ReturnNonEmptyValue ¶ added in v1.3.0
func ReturnNonEmptyValue[T any](a ...T) T
ReturnNonEmptyValue returns the information value that is not empty
func ReturnNonNilValue ¶ added in v1.3.0
func ReturnNonNilValue[T any](a ...T) T
ReturnNonNilValue returns the information value that is not nil
func SimpleConvertByteUnitStrToFloat ¶ added in v1.6.1
SimpleConvertByteUnitStrToFloat convert byte unit text to int ex: 1KB = 1024, if err return empty value
func SimpleConvertFileToBytes ¶ added in v1.0.6
SimpleConvertFileToBytes convert os.File value to slice byte, without error
func SimpleConvertMegaByteUnitStrToFloat ¶ added in v1.6.2
SimpleConvertMegaByteUnitStrToFloat convert megabyte unit text to int ex: 1GB = 1024, if err return empty value
func SimpleConvertToBase64 ¶ added in v1.0.9
SimpleConvertToBase64 convert any value to string base64, without error
func SimpleConvertToBool ¶ added in v1.0.3
SimpleConvertToBool convert any value to float, if err return empty value
func SimpleConvertToBuffer ¶ added in v1.0.7
SimpleConvertToBuffer convert any value to bytes.Buffer, without error
func SimpleConvertToBytes ¶ added in v1.0.3
SimpleConvertToBytes convert any value to bytes, if err return empty value
func SimpleConvertToDest ¶ added in v1.4.6
func SimpleConvertToDest(a, dest any)
SimpleConvertToDest convert value to dest param without error
func SimpleConvertToFile ¶ added in v1.0.7
SimpleConvertToFile convert any value to os.File .txt base64, without error
func SimpleConvertToFloat ¶ added in v1.0.3
SimpleConvertToFloat convert any value to float, if err return empty value
func SimpleConvertToInt ¶ added in v1.0.3
SimpleConvertToInt convert any value to int, if err return empty value
func SimpleConvertToObjectId ¶ added in v1.0.3
SimpleConvertToObjectId convert any value to primitive.ObjectID, if err return empty value, check using primitive.NilObjectID
func SimpleConvertToPrimitiveDateTime ¶ added in v1.1.7
SimpleConvertToPrimitiveDateTime convert any value to primitive.DateTime, if err return empty value
func SimpleConvertToReader ¶ added in v1.0.7
SimpleConvertToReader convert any value to bytes.Reader, without error
func SimpleConvertToString ¶ added in v1.0.3
SimpleConvertToString convert any value to beautiful string, if err return empty value
func SimpleConvertToTime ¶ added in v1.0.3
SimpleConvertToTime convert any value to time, if err return empty value
func SimpleConvertToTimeDuration ¶ added in v1.6.7
SimpleConvertToTimeDuration convert any value to time duration, if err return empty value