Documentation
¶
Index ¶
- func Atob(s string) bool
- func Atoi(s string) int
- func Base64StdDecode(data string) (string, error)
- func Base64StdEncode(data string) string
- func Base64UrlDecode(data string) (string, error)
- func Base64UrlEncode(data string) string
- func BoolPtrToBool(b *bool) bool
- func BoolToInt(b bool) int
- func Btoa(b bool) string
- func ByteToHex(data []byte) string
- func CopyDir(src string, dst string) error
- func CopyFile(src string, dst string) error
- func CurrentDate() string
- func CurrentDateStruct() time.Time
- func CurrentDateTime() string
- func CurrentDateTimeStruct() time.Time
- func CurrentTime() string
- func DateAfter(testDate time.Time, afterDate time.Time) bool
- func DateAfterOrEqual(testDate time.Time, afterEqualDate time.Time) bool
- func DateBefore(testDate time.Time, beforeDate time.Time) bool
- func DateBeforeOrEqual(testDate time.Time, beforeEqualDate time.Time) bool
- func DateBetween(testDate time.Time, fromDate time.Time, toDate time.Time, ...) bool
- func DateEqual(testDate time.Time, equalDate time.Time) bool
- func DateFormatString() string
- func DateOutside(testDate time.Time, fromDate time.Time, toDate time.Time) bool
- func DatePtrToString(t *time.Time) string
- func DateTimeFormatString() string
- func DateTimePtrToDateTime(t *time.Time) time.Time
- func DateTimePtrToString(t *time.Time) string
- func DateToLocal(t time.Time) (time.Time, error)
- func DateToLocal2(t time.Time) time.Time
- func DateToUTC(t time.Time) (time.Time, error)
- func DateToUTC2(t time.Time) time.Time
- func DaysDiff(timeFrom time.Time, timeTo time.Time) int
- func DnsLookupIps(host string) (ipList []net.IP)
- func DnsLookupSrvs(host string) (ipList []string)
- func DurationPtr(d time.Duration) *time.Duration
- func ExtractAlphaNumeric(s string) (string, error)
- func ExtractNumeric(s string) (string, error)
- func FileExists(path string) bool
- func FileRead(path string) (string, error)
- func FileWrite(path string, data string) error
- func Float32Ptr(f float32) *float32
- func Float32PtrToFloat32(f *float32) float32
- func Float32ToString(f float32) string
- func Float32ToStringCents(f float32) string
- func Float64Ptr(f float64) *float64
- func Float64PtrToFloat64(f *float64) float64
- func Float64ToInt(f float64) int
- func FloatToString(f float64) string
- func FormatDate(t time.Time) string
- func FormatDateTime(t time.Time) string
- func FormatDateTimeToMMDDYYYYhhmmss(t time.Time) string
- func FormatDateTimeToYYYYMMDDhhmmss(t time.Time) string
- func FormatDateToDDMMYYYY(t time.Time) string
- func FormatDateToMMDD(t time.Time) string
- func FormatDateToMMYY(t time.Time) string
- func FormatDateToYYMM(t time.Time) string
- func FormatDateToYYMMDD(t time.Time) string
- func FormatDateToYYYYMMDD(t time.Time) string
- func FormatTime(t time.Time) string
- func FromNullBool(b sql.NullBool) bool
- func FromNullFloat32(d sql.NullFloat64) float32
- func FromNullFloat64(d sql.NullFloat64) float64
- func FromNullInt(d sql.NullInt32) int
- func FromNullInt64(d sql.NullInt64) int64
- func FromNullString(s sql.NullString) string
- func FromNullTime(t sql.NullTime) time.Time
- func GenerateNewUniqueInt32(oldIntVal int) int
- func GenerateNewUniqueInt64(oldIntVal int64) int64
- func GenerateNewUniqueNullInt32(oldIntVal sql.NullInt32) sql.NullInt32
- func GenerateNewUniqueNullInt64(oldIntVal sql.NullInt64) sql.NullInt64
- func GenerateNewUniqueNullString(oldStrVal sql.NullString, stringLimit int) sql.NullString
- func GenerateNewUniqueString(oldStrVal string, stringLimit int) string
- func GenerateRandomChar() string
- func GenerateRandomNumber(maxNumber int) int
- func GenerateULID() (string, error)
- func GenerateUUIDv4() (string, error)
- func GetFirstBoolOrDefault(defaultValue bool, paramValue ...bool) bool
- func GetFirstByteOrDefault(defaultValue byte, paramValue ...byte) byte
- func GetFirstFloat32OrDefault(defaultValue float32, paramValue ...float32) float32
- func GetFirstFloat64OrDefault(defaultValue float64, paramValue ...float64) float64
- func GetFirstInt64OrDefault(defaultValue int64, paramValue ...int64) int64
- func GetFirstIntOrDefault(defaultValue int, paramValue ...int) int
- func GetFirstOrDefault(defaultValue interface{}, paramValue ...interface{}) interface{}
- func GetFirstStringOrDefault(defaultValue string, paramValue ...string) string
- func GetFirstTimeOrDefault(defaultValue time.Time, paramValue ...time.Time) time.Time
- func GetLocalIP() string
- func GetNetListener(port uint) (net.Listener, error)
- func GetStructTagValueByObject(structObj interface{}, structFieldName string, structTagName string) (notFound bool, tagValue string, t reflect.Type)
- func GetStructTagValueByType(t reflect.Type, structFieldName string, structTagName string) (notFound bool, tagValue string)
- func HTMLDecode(s string) string
- func HTMLEncode(s string) string
- func HexToByte(hexData string) ([]byte, error)
- func HexToString(hexData string) (string, error)
- func HoursDiff(timeFrom time.Time, timeTo time.Time) int
- func Int32PtrToInt(n *int) int
- func Int64Ptr(i int64) *int64
- func Int64PtrToInt64(n *int64) int64
- func Int64ToString(n int64) string
- func IntPtr(i int) *int
- func IsAlphanumericAndSpaceOnly(s string) bool
- func IsAlphanumericOnly(s string) bool
- func IsBase64Only(s string) bool
- func IsBool(s string) bool
- func IsDayOfMonthValid(year int, month int, day int) bool
- func IsFloat32(s string) bool
- func IsFloat64(s string) bool
- func IsHexOnly(s string) bool
- func IsInt32(s string) bool
- func IsInt64(s string) bool
- func IsLeapYear(year int) bool
- func IsNumericIntAndNegativeSignOnly(s string) bool
- func IsNumericIntOnly(s string) bool
- func Itoa(i int) string
- func Left(s string, l int) string
- func LenTrim(s string) int
- func LenTrimNullString(s sql.NullString) int
- func MarshalJSONCompact(v interface{}) (string, error)
- func MarshalJSONIndent(v interface{}) (string, error)
- func MarshalXML(v interface{}, indentXML bool) (string, error)
- func MarshalXMLCompact(v interface{}) (string, error)
- func MarshalXMLIndent(v interface{}) (string, error)
- func Mid(s string, start int, l int) string
- func MinutesDiff(timeFrom time.Time, timeTo time.Time) int
- func NewULID() string
- func NewUUID() string
- func NextFixedLength(data string, blockSize int) int
- func PadLeft(data string, totalSize int) string
- func PadRight(data string, totalSize int) string
- func Padding(data string, totalSize int, padRight bool, padChar string) string
- func ParseBool(s string) (bool, bool)
- func ParseDate(s string) time.Time
- func ParseDateFromDDMMYYYY(s string) time.Time
- func ParseDateFromMMDD(s string) time.Time
- func ParseDateFromMMYY(s string) time.Time
- func ParseDateFromYYMM(s string) time.Time
- func ParseDateFromYYMMDD(s string) time.Time
- func ParseDateFromYYYYMMDD(s string) time.Time
- func ParseDateTime(s string) time.Time
- func ParseDateTime24Hr(s string) time.Time
- func ParseDateTimeCustom(s string, f string) time.Time
- func ParseDateTimeFromMMDDYYYYhhmmss(s string) time.Time
- func ParseDateTimeFromYYYYMMDDhhmmss(s string) time.Time
- func ParseDateToLastDayOfMonth(t time.Time) time.Time
- func ParseFloat32(s string) (float32, bool)
- func ParseFloat64(s string) (float64, bool)
- func ParseHostFromURL(url string) string
- func ParseInt32(s string) (int, bool)
- func ParseInt64(s string) (int64, bool)
- func ParseKeyValue(s string, delimiter string, key *string, val *string) error
- func ParseTime(s string) time.Time
- func RegexReplaceSubString(source string, subStringFrom string, subStringTo string, replaceWith string, ...) string
- func Replace(s string, oldChar string, newChar string) string
- func Reverse(s string) string
- func Right(s string, l int) string
- func RightTrimLF(s string) string
- func SecondsDiff(timeFrom time.Time, timeTo time.Time) int
- func SliceObjectsToSliceInterface(objectsSlice interface{}) (output []interface{})
- func SplitString(source string, delimiter string, index int) string
- func StrToUint(s string) uint
- func StringPtr(s string) *string
- func StringPtrToString(s *string) string
- func StringToHex(data string) string
- func TimeFormatString() string
- func TimePtr(t time.Time) *time.Time
- func ToNullBool(b bool) sql.NullBool
- func ToNullFloat32(d float32, emptyAsNull bool) sql.NullFloat64
- func ToNullFloat64(d float64, emptyAsNull bool) sql.NullFloat64
- func ToNullInt(d int, emptyAsNull bool) sql.NullInt32
- func ToNullInt64(d int64, emptyAsNull bool) sql.NullInt64
- func ToNullString(s string, emptyAsNull bool) sql.NullString
- func ToNullTime(t time.Time) sql.NullTime
- func Trim(s string) string
- func UInt64ToString(n uint64) string
- func UintToStr(i uint) string
- func UnmarshalJSON(jsonData string, v interface{}) error
- func UnmarshalXML(xmlData string, v interface{}) error
- func XMLFromEscaped(data string) string
- func XMLToEscaped(data string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64StdDecode ¶
Base64StdDecode will decode given data from base 64 standard encoded string
func Base64StdEncode ¶
Base64StdEncode will encode given data into base 64 standard encoded string
func Base64UrlDecode ¶
Base64UrlDecode will decode given data from base 64 url encoded string
func Base64UrlEncode ¶
Base64UrlEncode will encode given data into base 64 url encoded string
func BoolPtrToBool ¶
BoolPtrToBool converts bool pointer to bool value
func CurrentDateStruct ¶
CurrentDateStruct returns current date in yyyy-mm-dd format via time.Time struct
func CurrentDateTime ¶
func CurrentDateTime() string
CurrentDateTime returns current date and time in yyyy-mm-dd hh:mm:ss tt format
func CurrentDateTimeStruct ¶
CurrentDateTimeStruct returns current date and time in yyyy-mm-dd hh:mm:ss tt format via time.Time struct
func DateAfterOrEqual ¶
DateAfterOrEqual checks if testDate is after or equal to the afterEqualDate
func DateBefore ¶
DateBefore checks if testDate is before the beforeDate
func DateBeforeOrEqual ¶
DateBeforeOrEqual checks if testDate is before or equal to the beforeEqualDate
func DateBetween ¶
func DateBetween(testDate time.Time, fromDate time.Time, toDate time.Time, doNotIncludeEqual bool) bool
DateBetween checks if testDate is within the fromDate and toDate, if doNotIncludeEqual = true, then testDate equals fromDate and toDate are skipped
func DateFormatString ¶
func DateFormatString() string
DateFormatString returns the date format string constant (yyyy-mm-dd)
func DateOutside ¶
DateOutside checks if the testDate is outside of the fromDate and toDate
func DatePtrToString ¶
DatePtrToString formats pointer time.Time to string date format
func DateTimeFormatString ¶
func DateTimeFormatString() string
DateTimeFormatString returns the date time format string constant (yyyy-mm-dd hh:mm:ss tt)
func DateTimePtrToDateTime ¶
DateTimePtrToDateTime formats pointer time.Time to time.Time struct
func DateTimePtrToString ¶
DateTimePtrToString formats pointer time.Time to string date time format
func DateToLocal ¶
DateToLocal converts given time to local time
func DateToLocal2 ¶
DateToLocal2 returns local value directly without error info
func DateToUTC2 ¶
DateToUTC2 returns utc value directly without error info
func DnsLookupIps ¶
DnsLookupIps returns list of IPs for the given host if host is private on aws route 53, then lookup ip will work only when within given aws vpc that host was registered with
func DnsLookupSrvs ¶
DnsLookupSrvs returns list of IP and port addresses based on host if host is private on aws route 53, then lookup ip will work only when within given aws vpc that host was registered with
func DurationPtr ¶
DurationPtr casts Duration to Duration pointer
func ExtractAlphaNumeric ¶
ExtractAlphaNumeric will extract only A-Z, a-z, and 0-9 out of string to be returned
func ExtractNumeric ¶
ExtractNumeric will extract only 0-9 out of string to be returned
func FileRead ¶
FileRead will read all file content of given file in path, return as string if successful, if failed, error will contain the error reason
func FileWrite ¶
FileWrite will write data into file at the given path, if succesful, no error is returned (nil)
func Float32PtrToFloat32 ¶
Float32PtrToFloat32 returns 0 if nil, otherwise actual float32 value
func Float32ToString ¶
Float32ToString converts float32 into string value
func Float32ToStringCents ¶
Float32ToStringCents converts float32 into string representing cent values
func Float64PtrToFloat64 ¶
Float64PtrToFloat64 returns 0 if nil, otherwise actual float64 value
func FloatToString ¶
FloatToString converts float64 into string value
func FormatDate ¶
FormatDate will format the input date value to yyyy-mm-dd
func FormatDateTime ¶
FormatDateTime will format the input date value to yyyy-mm-dd hh:mm:ss tt
func FormatDateTimeToMMDDYYYYhhmmss ¶
FormatDateTimeToMMDDYYYYhhmmss for the date time struct received
func FormatDateTimeToYYYYMMDDhhmmss ¶
FormatDateTimeToYYYYMMDDhhmmss for the date time struct received
func FormatDateToDDMMYYYY ¶
FormatDateToDDMMYYYY for the date time struct received
func FormatDateToMMDD ¶
FormatDateToMMDD for the date time struct received
func FormatDateToMMYY ¶
FormatDateToMMYY for the date time struct received
func FormatDateToYYMM ¶
FormatDateToYYMM for the date time struct received
func FormatDateToYYMMDD ¶
FormatDateToYYMMDD for the date time struct received
func FormatDateToYYYYMMDD ¶
FormatDateToYYYYMMDD for the date time struct received
func FormatTime ¶
FormatTime will format the input date value to hh:mm:ss tt
func FromNullBool ¶
FromNullBool casts sql null bool variable to bool variable, if null, false is returned
func FromNullFloat32 ¶
func FromNullFloat32(d sql.NullFloat64) float32
FromNullFloat32 casts sql null float64 into float32 variable
func FromNullFloat64 ¶
func FromNullFloat64(d sql.NullFloat64) float64
FromNullFloat64 casts sql null float64 variable to float64 variable, if null, 0.00 is returned
func FromNullInt ¶
FromNullInt casts sql NullInt32 into int variable, if null, 0 is returned
func FromNullInt64 ¶
FromNullInt64 casts sql null int64 variable to int64 variable, if null, 0 is returned
func FromNullString ¶
func FromNullString(s sql.NullString) string
FromNullString casts sql null string variable to string variable, if null, blank string is returned
func FromNullTime ¶
FromNullTime parses string into time.Time
func GenerateNewUniqueInt32 ¶
GenerateNewUniqueInt32 will take in old value and return new unique value with randomized seed and negated
func GenerateNewUniqueInt64 ¶
GenerateNewUniqueInt64 will take in old value and return new unique value with randomized seed and negated
func GenerateNewUniqueNullInt32 ¶
GenerateNewUniqueNullInt32 will take in old value and return new unique value with randomized seed and negated
func GenerateNewUniqueNullInt64 ¶
GenerateNewUniqueNullInt64 will take in old value and return new unique value with randomized seed and negated
func GenerateNewUniqueNullString ¶
func GenerateNewUniqueNullString(oldStrVal sql.NullString, stringLimit int) sql.NullString
GenerateNewUniqueNullString will take in old value and return new unique value with randomized seed
stringLimit = 0 no limit, > 0 has limit
func GenerateNewUniqueString ¶
GenerateNewUniqueString will take in old value and return new unique value with randomized seed
stringLimit = 0 no limit, > 0 has limit
func GenerateRandomChar ¶
func GenerateRandomChar() string
GenerateRandomChar will create a random character, using unix nano as seed
func GenerateRandomNumber ¶
GenerateRandomNumber with unix nano as seed
func GenerateULID ¶
GenerateULID will generate a ULID that is globally unique (very slim chance of collision)
func GenerateUUIDv4 ¶
GenerateUUIDv4 will generate a UUID Version 4 (Random) to represent a globally unique identifier (extremely rare chance of collision)
func GetFirstBoolOrDefault ¶
GetFirstBoolOrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstByteOrDefault ¶
GetFirstByteOrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstFloat32OrDefault ¶
GetFirstFloat32OrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstFloat64OrDefault ¶
GetFirstFloat64OrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstInt64OrDefault ¶
GetFirstInt64OrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstIntOrDefault ¶
GetFirstIntOrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstOrDefault ¶
func GetFirstOrDefault(defaultValue interface{}, paramValue ...interface{}) interface{}
GetFirstOrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstStringOrDefault ¶
GetFirstStringOrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetFirstTimeOrDefault ¶
GetFirstTimeOrDefault will select the first variadic value from paramValue, if no paramValue variadic, then defaultValue is used as return value
func GetNetListener ¶
GetNetListener triggers the specified port to listen via tcp
func GetStructTagValueByObject ¶
func GetStructTagValueByObject(structObj interface{}, structFieldName string, structTagName string) (notFound bool, tagValue string, t reflect.Type)
GetStructTagValueByObject will accept a struct object, struct field name, and struct tag name, and return the found tag value and reflect type, if reflect type or struct tag is not found, a notFound is returned [ Parameters ]
structObj = struct object variable structFieldName = struct's field name (CASE SENSITIVE) structTagName = struct's tag name (the left side of struct tag - the key portion) (CASE SENSITIVE)
func GetStructTagValueByType ¶
func GetStructTagValueByType(t reflect.Type, structFieldName string, structTagName string) (notFound bool, tagValue string)
GetStructTagValueByType will accept a prior obtained reflect type, struct field name, and struct tag name, and return the found tag value, if struct tag value is not found, a notFound is returned, if the reflect type is nil, then not found is returned too [ Parameters ]
t = reflect type of a struct object (obtained via GetStructTagValueByObject) structFieldName = struct's field name (CASE SENSITIVE) structTagName = struct's tag name (the left side of struct tag - the key portion) (CASE SENSITIVE)
func HTMLDecode ¶
HTMLDecode will unescape html tags and extended tags relevant to our apps
func HexToString ¶
HexToString converts hex data into string
func Int32PtrToInt ¶
Int32PtrToInt returns 0 if nil, otherwise actual int value
func Int64PtrToInt64 ¶
Int64PtrToInt64 returns 0 if nil, otherwise actual int64 value
func Int64ToString ¶
Int64ToString converts int64 into string value
func IsAlphanumericAndSpaceOnly ¶
IsAlphanumericAndSpaceOnly checks if the input string is A-Z, a-z, 0-9, and space
func IsAlphanumericOnly ¶
IsAlphanumericOnly checks if the input string is A-Z, a-z, and 0-9 only
func IsBase64Only ¶
IsBase64Only checks if the input string is a-z, A-Z, 0-9, +, /, =
func IsDayOfMonthValid ¶
IsDayOfMonthValid checks if the month day number is valid
func IsLeapYear ¶
IsLeapYear checks if the year input is leap year or not
func IsNumericIntAndNegativeSignOnly ¶
IsNumericIntAndNegativeSignOnly checks if the input string is 0-9 and possibly with lead negative sign only
func IsNumericIntOnly ¶
IsNumericIntOnly checks if the input string is 0-9 only
func LenTrimNullString ¶
func LenTrimNullString(s sql.NullString) int
LenTrimNullString returns string length
func MarshalJSONCompact ¶
MarshalJSONCompact will accept an input variable, typically struct with json struct tags, to serialize from object into json string with compact formatting
*** STRUCT FIELDS MUST BE EXPORTED FOR MARSHAL AND UNMARSHAL ***
struct json tags:
`json:"ElementName"` <<< JSON Element Name `json:"...,omitempty"` <<< Omit This Line if Empty Value (false, 0, nil, zero length array) `json:"-"` <<< Omit From JSON Marshal
func MarshalJSONIndent ¶
MarshalJSONIndent will accept an input variable, typically struct with json struct tags, to serialize from object into json string with indented formatting
*** STRUCT FIELDS MUST BE EXPORTED FOR MARSHAL AND UNMARSHAL ***
struct json tags:
`json:"ElementName"` <<< JSON Element Name `json:"...,omitempty"` <<< Omit This Line if Empty Value (false, 0, nil, zero length array) `json:"-"` <<< Omit From JSON Marshal
func MarshalXML ¶
MarshalXML with option for indent or compact
func MarshalXMLCompact ¶
MarshalXMLCompact will accept an input variable, typically struct with xml struct tags, to serialize from object into xml string
*** STRUCT FIELDS MUST BE EXPORTED FOR MARSHAL AND UNMARSHAL ***
special struct field:
XMLName xml.Name `xml:"ElementName"`
struct xml tags:
`xml:"AttributeName,attr"` or `xml:",attr"` <<< Attribute Instead of Element `xml:"ElementName"` <<< XML Element Name `xml:"OuterElementName>InnerElementName"` <<< Outer XML Grouping By OuterElementName `xml:",cdata"` <<< <![CDATA[...]] `xml:",innerxml"` <<< Write as Inner XML Verbatim and Not Subject to Marshaling `xml:",comment"` <<< Write as Comment, and Not Contain "--" Within Value `xml:"...,omitempty"` <<< Omit This Line if Empty Value (false, 0, nil, zero length array) `xml:"-"` <<< Omit From XML Marshal
func MarshalXMLIndent ¶
MarshalXMLIndent will accept an input variable, typically struct with xml struct tags, to serialize from object into xml string with indented formatting
*** STRUCT FIELDS MUST BE EXPORTED FOR MARSHAL AND UNMARSHAL ***
special struct field:
XMLName xml.Name `xml:"ElementName"`
struct xml tags:
`xml:"AttributeName,attr"` or `xml:",attr"` <<< Attribute Instead of Element `xml:"ElementName"` <<< XML Element Name `xml:"OuterElementName>InnerElementName"` <<< Outer XML Grouping By OuterElementName `xml:",cdata"` <<< <![CDATA[...]] `xml:",innerxml"` <<< Write as Inner XML Verbatim and Not Subject to Marshaling `xml:",comment"` <<< Write as Comment, and Not Contain "--" Within Value `xml:"...,omitempty"` <<< Omit This Line if Empty Value (false, 0, nil, zero length array) `xml:"-"` <<< Omit From XML Marshal
func Mid ¶
Mid returns the middle of string indicated by variable start and l positions (size of substring)
func MinutesDiff ¶
MinutesDiff gets the minutes difference between from and to date
func NewUUID ¶
func NewUUID() string
NewUUID will generate a UUID Version 4 (Random) and ignore error if any
func NextFixedLength ¶
NextFixedLength calculates the next fixed length total block size, for example, if block size is 16, then the total size should be 16, 32, 48 and so on based on data length
func ParseBool ¶
ParseBool tests and parses if input string is boolean, return value 1st bool is the boolean result, return value 2nd bool is the ParseBool success or failure indicator
func ParseDate ¶
ParseDate will parse a date value in yyyy-mm-dd format into time.Time object, check time.IsZero() to verify if a zero time is returned indicating parser failure
func ParseDateFromDDMMYYYY ¶
ParseDateFromDDMMYYYY from string value
func ParseDateFromMMDD ¶
ParseDateFromMMDD from string value
func ParseDateFromMMYY ¶
ParseDateFromMMYY from string value
func ParseDateFromYYMM ¶
ParseDateFromYYMM from string value
func ParseDateFromYYMMDD ¶
ParseDateFromYYMMDD from string value
func ParseDateFromYYYYMMDD ¶
ParseDateFromYYYYMMDD from string value
func ParseDateTime ¶
ParseDateTime will parse a date time value in yyyy-mm-dd hh:mm:ss tt format into time.Time object, check time.IsZero() to verify if a zero time is returned indicating parser failure
func ParseDateTime24Hr ¶
ParseDateTime24Hr will parse a date time value in yyyy-mm-dd HH:mm:ss format into time.Time object, check time.IsZero() to verify if a zero time is returned indicating parser failure
func ParseDateTimeCustom ¶
ParseDateTimeCustom will parse a date time value in s string, based on the f format f format is 2006 01 02 15:04:05 / 03:04:05 PM
func ParseDateTimeFromMMDDYYYYhhmmss ¶
ParseDateTimeFromMMDDYYYYhhmmss from string value
func ParseDateTimeFromYYYYMMDDhhmmss ¶
ParseDateTimeFromYYYYMMDDhhmmss from string value
func ParseDateToLastDayOfMonth ¶
ParseDateToLastDayOfMonth
func ParseFloat32 ¶
ParseFloat32 tests and parses if input string is float 32 bit (decimal point value)
func ParseFloat64 ¶
ParseFloat64 tests and parses if input string is float 64 bit (decimal point value)
func ParseHostFromURL ¶
ParseHostFromURL will parse out the host name from url
func ParseInt32 ¶
ParseInt32 tests and parses if input string is integer (whole numbers 32 bits)
func ParseInt64 ¶
ParseInt64 tests and parses if input string is big integer (whole number greater 64 bits)
func ParseKeyValue ¶
ParseKeyValue will parse the input string using specified delimiter (= is default), result is set in the key and val fields
func ParseTime ¶
ParseTime will parse a time vaule in hh:mm:ss tt format into time.Time object, check time.IsZero() to verify if a zero time is returned indicating parser failure
func RegexReplaceSubString ¶
func RegexReplaceSubString(source string, subStringFrom string, subStringTo string, replaceWith string, caseInsensitive bool) string
RegexReplaceSubString will search for substring between subStringFrom and subStringTo, replace with the replaceWith string, and optionally case insensitive or not
func RightTrimLF ¶
RightTrimLF will remove linefeed (return char) from the right most char and return result string
func SecondsDiff ¶
SecondsDiff gets the seconds difference between from and to date
func SliceObjectsToSliceInterface ¶
func SliceObjectsToSliceInterface(objectsSlice interface{}) (output []interface{})
SliceObjectsToSliceInterfaces will convert slice of objects into slice of interfaces
func SplitString ¶
SplitString will split the source string using delimiter, and return the element indicated by index, if nothing is found, blank is returned, index = -1 returns last index
func StringPtrToString ¶
StringPtrToString gets string value from string pointer
func TimeFormatString ¶
func TimeFormatString() string
TimeFormatString returns the time format string constant (hh:mm:ss tt)
func ToNullFloat32 ¶
func ToNullFloat32(d float32, emptyAsNull bool) sql.NullFloat64
ToNullFloat32 sets float32 into NullFloat64 output
func ToNullFloat64 ¶
func ToNullFloat64(d float64, emptyAsNull bool) sql.NullFloat64
ToNullFloat64 sets float64 into NullFloat64 output
func ToNullInt64 ¶
ToNullInt64 sets int64 value into NullInt64 output
func ToNullString ¶
func ToNullString(s string, emptyAsNull bool) sql.NullString
ToNullString sets string value into NullString output
func ToNullTime ¶
ToNullTime sets time.Time into NullTime output
func UInt64ToString ¶
UInt64ToString converts uint64 into string value
func UnmarshalJSON ¶
UnmarshalJSON will accept input json data string and deserialize into target object indicated by parameter v
*** PASS PARAMETER AS "&v" IN ORDER TO BE WRITABLE ***
*** STRUCT FIELDS MUST BE EXPORTED FOR MARSHAL AND UNMARSHAL ***
if unmarshal is successful, nil is returned, otherwise error info is returned
func UnmarshalXML ¶
UnmarshalXML will accept input xml data string and deserialize into target object indicated by parameter v
*** PASS PARAMETER AS "&v" IN ORDER TO BE WRITABLE ***
*** STRUCT FIELDS MUST BE EXPORTED FOR MARSHAL AND UNMARSHAL ***
if unmarshal is successful, nil is returned, otherwise error info is returned
func XMLFromEscaped ¶
XMLFromEscaped will un-escape the data whose > < & % ' " are converted to > < & % ' "
func XMLToEscaped ¶
XMLToEscaped will escape the data whose xml special chars > < & % ' " are escaped into > < & % ' "
Types ¶
This section is empty.