Documentation
¶
Index ¶
- Constants
- func ConvertAmountToString(a int64, decimalSep string) string
- func ConvertStringToAmount(s string, decimalSep string, thousandSep string) (int64, error)
- func DebugPrintf(format string, a ...interface{}) (n int, err error)
- func DownloadFromS3(bucketName string, itemName string) (string, error)
- func ErrorPrintf(format string, a ...interface{}) (n int, err error)
- func ExtractEncodedArrayFields(param map[string]string, data []map[string]interface{}) []map[string]string
- func ExtractEncodedFields(param map[string]string, data map[string]interface{}) map[string]string
- func GetContentFromS3(bucket string, bucketFileConf string) ([]byte, error)
- func GetMonthProrata(startsAt time.Time, endsAt time.Time, mode int) float32
- func InfoPrintf(format string, a ...interface{}) (n int, err error)
- func ListObjects(bucketName string) ([]string, error)
- func NoticePrintf(format string, a ...interface{}) (n int, err error)
- func RandomHex(n int) string
- func Unzip(src string, dest string) ([]string, error)
- func WarningPrintf(format string, a ...interface{}) (n int, err error)
Constants ¶
const ( InfoColor = "\033[1;34m" NoticeColor = "\033[1;36m" WarningColor = "\033[1;33m" ErrorColor = "\033[1;31m" DebugColor = "\033[0;36m" )
colors for terminal ouput
const ( ProrataStrict = 0 ProrataEndOfMonth = 1 ProrataBeginOfMonth = 2 ProrataBoth = 3 )
constants to interpret month prorata calculation
Variables ¶
This section is empty.
Functions ¶
func ConvertAmountToString ¶
ConvertAmountToString function converts a amount of CENTS into a real string
func ConvertStringToAmount ¶
ConvertStringToAmount function converts a string amount into an int64 of CENTS. we use that trick to avoid any float in the app (and rounding issues) " - 1234,43 " --> -123443 "0" --> 0 "345 " --> 34500 " 345,1" --> 3451 "- 0,00" --> 0 "345," --> 3450
func DebugPrintf ¶
DebugPrintf print a debug txt
func DownloadFromS3 ¶
DownloadFromS3 will get the file from the given bucket and path and will return the complete path of downloaded file or an error
func ErrorPrintf ¶
ErrorPrintf print an error txt
func ExtractEncodedArrayFields ¶
func ExtractEncodedArrayFields(param map[string]string, data []map[string]interface{}) []map[string]string
ExtractEncodedArrayFields is used to filter and safestring an array of data map got from a query
func ExtractEncodedFields ¶
ExtractEncodedFields is used to filter and safestring a data map got from a query
func GetContentFromS3 ¶
GetContentFromS3 will download the conf file from S3 and return the content as a file
func GetMonthProrata ¶
GetMonthProrata returns a float representing the number of monthes between two dates with the rounding rules given above
func InfoPrintf ¶
InfoPrintf print an info txt
func ListObjects ¶
ListObjects returns a list of objects in a bucket name
func NoticePrintf ¶
NoticePrintf print an notice txt
func Unzip ¶
Unzip will decompress a zip archive, moving all files. No folders will be created within the zip file (parameter 1) to an output directory (parameter 2).
func WarningPrintf ¶
WarningPrintf print a warning txt
Types ¶
This section is empty.