Documentation ¶
Overview ¶
Package utif stands for Utility Functions, providing different functions to facilitate common tasks
Package utif stands for Utility Functions, providing different functions to facilitate common tasks ¶
Package utif stands for Utility Functions, providing different functions to facilitate common tasks
Index ¶
- func FloatValue(intValue sql.NullFloat64) float64
- func FloatsliceToCSV(a []float64, sep string) string
- func Int64SliceToCSV(a []int64, sep string) string
- func IntSliceToCSV(a []int, sep string) string
- func IntValue(intValue sql.NullInt32) int32
- func IsValidEmail(email string) bool
- func IsValidIp(ip string) bool
- func JSONStringToStruct(jsonstring string, dest interface{}) error
- func MD5Str(s, salt string) string
- func MD5Struct(o interface{}, salt string) string
- func RandStringAlpha(lenght int) string
- func RandStringAlphaNumeric(lenght int) string
- func RandStringNumeric(lenght int) string
- func Sha256Str(s, salt string) string
- func Sha256Struct(o interface{}, salt string) string
- func StoI(array interface{}) []interface{}
- func StringValue(stringValue sql.NullString) string
- func StructToJSON(d interface{}) ([]byte, error)
- func StructToJSONString(d interface{}) (string, error)
- func TimeTrack(start time.Time)
- func TimeValue(timeValue sql.NullTime) time.Time
- func ToString(t interface{}) (string, bool)
- func ToStringx(t interface{}) string
- func Track(start time.Time, fnname string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FloatValue ¶
func FloatValue(intValue sql.NullFloat64) float64
FloatValue return float value from sql.NullFloat64, if has invalid value then zero value will be returned.
func FloatsliceToCSV ¶ added in v0.0.2
sliceToStringFloat convert slice to float64 to comma separated string
func Int64SliceToCSV ¶ added in v0.0.2
Int64SliceToCSV convert slice of int64 to comma separated string
func IntSliceToCSV ¶
IntSliceToCSV convert slice of int to comma separated string
func IntValue ¶
IntValue return int value from sql.NullInt32, if has invalid value then zero value will be returned.
func IsValidEmail ¶ added in v0.0.3
func JSONStringToStruct ¶
JSONStringToStruct convert JSON string to given struct
func RandStringAlpha ¶
RandStringAlpha returns random alphabet string of given length
func RandStringAlphaNumeric ¶
RandStringAlphaNumeric returns random alpha-numeric string of given length
func RandStringNumeric ¶
RandStringNumeric returns random numeric string of given length
func Sha256Struct ¶
Sha256Struct gives SHA256 hash of given struct and salt
func StoI ¶
func StoI(array interface{}) []interface{}
StoI converts slice of struct to slice of interface
func StringValue ¶
func StringValue(stringValue sql.NullString) string
StringValue return string value from sql.NullString, if has invalid value then zero value will be returned.
func StructToJSON ¶
StructToJSON convert given struct to JSON []byte
func StructToJSONString ¶
StructToJSONString convert given struct to JSON
func TimeTrack ¶
TimeTrack allow to time given function by passing it start time. Caller function name will be extacted from runtime.
func TimeValue ¶
TimeValue return time value from sql.NullTime, if has invalid value then 1900-01-01 will be returned.
Types ¶
This section is empty.