# README
Utility library containing commonly used functions
# Packages
No description provided by the author
# Functions
ByteArrToString converts a byte array to string.
ContainsOnlyMapType checks that a slice contains map[string]interface{} type.
CopyToStruct copies an object into another object.
CryptoRandKey creates a random string of a specific length to be used as a cryptography key.
DecodeJSONToMap decode json string to map.
DownloadURL downloads content from a url and returns buffer.
DownloadURLToFunc fetches the content from a url and pass downloaded chunks to a callback function.
Env gets environment variable or return a default value when no set.
FloatToString given a float value, it returns a full string representation of the value.
FromBSONMap converts bson map to a different struct or map type.
FromIncomingMD gets a metadata field from a context's incoming metadata.
FromJSON converts json to struct or map.
FromMD gets a metadata field from a context of metadata.MD.
GetAuthToken returns authorization code of a specific bearer from a context.
GetDupItem takes a slice of maps or a slice of struct type and looks for items in the slice that have a specific field that already exists in the slice.
GetIPs returns all the ip chains of the request.
GetJWSPayload gets the encoded payload from a JWS token.
GetMapKeys gets all the keys of a map.
GetRandFromSlice returns a random value from a slice of interface.
GetRandFromStringSlice returns a random value from a slice of string.
HasKey checks if a key exists in a map.
IfNil will run a callback function if val is nil.
IfNilEmptyStringSlice returns an empty string slice.
InStringSlice takes an interface that it expects to be a slice of string or a slice of interface and attempts to find a string value in the slice.
InStringSliceRx check whether a regex pattern matches an item in a string only slice.
IntToFloat64 cast int value to float64.
IntToString converts int to string.
IsInt checks whether the value passed is an integer.
IsJSONNumber checks whether the value passed is a json.Number type.
IsMapEmpty check if a map is empty.
IsMapOfAny checks that a variable value type is a map of any value.
IsNumberValue checks whether the value passed is int, float64, float32 or int64.
IsSlice checks that a variable value type is a slice.
IsSliceOfStrings Checks if a slice contains only string values.
IsStringValue checks that a value type is string.
JSONNumberToInt64 converts a json.Number object to Int64.
JSONToMap decodes a json string to a map.
JSONToSliceOfMap converts stringified JSON array to slice of maps.
JSONToSliceString converts stringified JSON array to slice of string.
LogHook attaches an hook to the global logger.
LogSetFormatter updates the formatter of the global logger.
Map casts an interface to Map type.
MapToJSON returns a json string representation of a map.
MustStringify encodes an object to json.
NewGetRequest creates a http GET request.
NewID generates an id for use as an id.
NewPostRequest creates a http POST request.
OnTerminate calls a function when a terminate or interrupt signal is received.
Printify prints pretty objects.
Println prints errors to stderr using a looger.
RandNum generates random numbers between a range.
RandString gets random string of fixed length.
ReadFromFixtures reads files from /tests/fixtures/ directory.
ReadJSONFile reads and decode json file.
ReadReader reads n bytes from a pipe and pass bytes read to a callback.
RemoveEmptyInStringSlice takes a slice of strings and removes empty values.
RenderTemp takes a template string and parses it with the temp data.
Sha1 returns a sha1 hash.
Sha256 returns a sha256 hash.
Spinner prints a loading spinner to the terminal.
StringSliceMatchString takes a slice of regex pattern and a string to match and returns the pattern that matches the string to match.
StrToPtr returns a pointer to a string.
ToInt64 converts int, float32 and float64 to int64.
ToJSON converts struct or map to json.
ToSliceInterface takes a slice and returns a slice of interfaces.
UniqueStringSlice returns a new string slice with duplicates removed.
UnixToTime converts a unix time to time object.
UUID4 returns a UUID v4 string.
# Variables
Log is a global logger.