# README
go-utils
do not use in production
Example
see test files
# Functions
CompareHash and return error if not equil.
ContainsString returns true if a string is present in a iteratee.
ContainsStrings returns true if a strings is present in a iteratee.
DefaultIfNil checks if the value is nil, if true returns the default value otherwise the original.
FilterRead is used to filter output to onlly output what client can see based on scopes.
FirstNonNil returns the first non nil parameter.
GenerateRandomBytes returns securely generated random bytes.
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.
GetHash from string.
IfThen evaluates a condition, if true returns the parameters otherwise nil.
IfThenElse evaluates a condition, if true returns the first parameter otherwise the second.
MatchScopes matches two scopes using Wildcard Scope Matching Strategy (asymetric).
Make the Attrs struct implement the sql.Scanner interface.
ScopeInAllowed is used to check if scope is allowed based on allowed scopes list.
StringToDate attempts to parse a string into a time.Time type using a predefined list of formats.
ToBool casts an interface to a bool type.
ToBoolE casts an interface to a bool type.
ToBoolSlice casts an interface to a []bool type.
ToBoolSliceE casts an interface to a []bool type.
ToDuration casts an interface to a time.Duration type.
ToDurationE casts an interface to a time.Duration type.
ToDurationSlice casts an interface to a []time.Duration type.
ToDurationSliceE casts an interface to a []time.Duration type.
ToFloat32 casts an interface to a float32 type.
ToFloat32E casts an interface to a float32 type.
ToFloat64 casts an interface to a float64 type.
ToFloat64E casts an interface to a float64 type.
ToInt casts an interface to an int type.
ToInt16 casts an interface to an int16 type.
ToInt16E casts an interface to an int16 type.
ToInt32 casts an interface to an int32 type.
ToInt32E casts an interface to an int32 type.
ToInt64 casts an interface to an int64 type.
ToInt64E casts an interface to an int64 type.
ToInt8 casts an interface to an int8 type.
ToInt8E casts an interface to an int8 type.
ToIntE casts an interface to an int type.
ToIntSlice casts an interface to a []int type.
ToIntSliceE casts an interface to a []int type.
ToSlice casts an interface to a []interface{} type.
ToSliceE casts an interface to a []interface{} type.
ToString casts an interface to a string type.
ToStringE casts an interface to a string type.
ToStringMap casts an interface to a map[string]interface{} type.
ToStringMapBool casts an interface to a map[string]bool type.
ToStringMapBoolE casts an interface to a map[string]bool type.
ToStringMapE casts an interface to a map[string]interface{} type.
ToStringMapInt casts an interface to a map[string]int type.
ToStringMapInt64 casts an interface to a map[string]int64 type.
ToStringMapInt64E casts an interface to a map[string]int64{} type.
ToStringMapIntE casts an interface to a map[string]int{} type.
ToStringMapString casts an interface to a map[string]string type.
ToStringMapStringE casts an interface to a map[string]string type.
ToStringMapStringSlice casts an interface to a map[string][]string type.
ToStringMapStringSliceE casts an interface to a map[string][]string type.
ToStringSlice casts an interface to a []string type.
ToStringSliceE casts an interface to a []string type.
ToTime casts an interface to a time.Time type.
ToTimeE casts an interface to a time.Time type.
ToUint casts an interface to a uint type.
ToUint16 casts an interface to a uint16 type.
ToUint16E casts an interface to a uint16 type.
ToUint32 casts an interface to a uint32 type.
ToUint32E casts an interface to a uint32 type.
ToUint64 casts an interface to a uint64 type.
ToUint64E casts an interface to a uint64 type.
ToUint8 casts an interface to a uint8 type.
ToUint8E casts an interface to a uint type.
ToUintE casts an interface to a uint type.
No description provided by the author
# Structs
No description provided by the author