-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4973936
commit b204ee8
Showing
8 changed files
with
65 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
# Module goutils | ||
|
||
Functions used in everyday life that help a lot. | ||
|
||
### Dependencia | ||
|
||
```shell | ||
go get go.mongodb.org/[email protected] | ||
``` | ||
|
||
## Installation | ||
|
||
```shell script | ||
$ go get github.com/armando-couto/goutils | ||
``` | ||
|
||
## Methods | ||
|
||
### arquivo.go | ||
|
||
```go | ||
ListFolderFiles(path string) Return []os.FileInfo | ||
ReadingFiles(path string, fileName string) Return string | ||
|
@@ -25,41 +30,48 @@ Backup(path, name, texto string) Return void | |
``` | ||
|
||
### array.go | ||
|
||
````go | ||
ContainsToStringInArray(a []string, x string) Return int | ||
```` | ||
|
||
### aws_sqs.go | ||
|
||
```go | ||
ConectionSQS() Return *sqs.SQS | ||
TokenGeneratorMessageId() Return string | ||
``` | ||
|
||
### base64.go | ||
|
||
```go | ||
EncodeStringToBase64(value string) Return string | ||
DecodeBase64ToString(value string) Return string | ||
``` | ||
|
||
### bool.go | ||
|
||
```go | ||
ContainsToStringInArrayReturnBool(a []string, x string) Return bool | ||
``` | ||
|
||
### cpf_cnpj.go | ||
|
||
```go | ||
ValidationCPF(cpf string) Return error | ||
ValidationCNPJ(cnpj string) Return error | ||
``` | ||
|
||
### csv.go | ||
|
||
```go | ||
CSVGZExport(StructCsv [][]string, nomeArquivo string) Return error | ||
CSVRead(pathFile string) Return [][]string | ||
GeneratorFilesGen(payload []interface{}, f func([][]string) [][]string, nomeArq string) Return error | ||
GeneratorFilesGen(payload []interface{}, f func ([][]string) [][]string, nomeArq string) Return error | ||
``` | ||
|
||
### datetime.go | ||
|
||
```go | ||
ConvertStringToTimeLayoutDDMMYYYY(value string) Return time.Time | ||
ConvertTimeToStringLayoutDD_MM_YYYY(date time.Time) Return string | ||
|
@@ -79,18 +91,20 @@ ConvertStringToTimeLayoutYYYY_MM_DDTHH_MM_SS_000(value string) Return time.Time | |
ConvertStringToTimeLayoutHHMMSS(value string) Return time.Time | ||
ConvertStringToTimeLayoutHH_MM_SS(value string) Return time.Time | ||
ConvertStringToTimeLayoutDDMMYYYYHHMMSS(d time.Time, h time.Time) Return time.Time | ||
RangeDate(end, start time.Time) func() Return time.Time | ||
RangeDate(end, start time.Time) func () Return time.Time | ||
DatePlusTime(date, timeOfDay time.Time) Returns (time.Time, error) | ||
WeekStartDate(date time.Time) time.Time | ||
WeekEndDate(date time.Time) time.Time | ||
``` | ||
|
||
### environment.go | ||
|
||
```go | ||
Godotenv(key string) Return string | ||
``` | ||
|
||
### float.go | ||
|
||
```go | ||
Subtract(valo1, valor2 float64) Return float64 | ||
ConvertFloatToFloatScale2(valor float64) Return float64 | ||
|
@@ -104,12 +118,14 @@ ConvertFloatToBrMoneyString(value float64) Return string | |
``` | ||
|
||
### ftp.go | ||
|
||
```go | ||
ListOfAvailableFilesNoFTP(remote string, port string, user string, pass string) Returns (*ftp.ServerConn, error, []string) | ||
GetHostKey(host string, isProduction bool) Return ssh.PublicKey | ||
``` | ||
|
||
### integer.go | ||
|
||
```go | ||
ContainsInt(a []int, x int) Return bool | ||
ConvertStringToInt5Digits(value string) Return int | ||
|
@@ -118,23 +134,27 @@ ConvertIntToString(value int) Return string | |
``` | ||
|
||
### logger_file.go | ||
|
||
```go | ||
CreateFileDayInfo(message string) Return void | ||
CreateFileDayError(message string) Return void | ||
CreateFileDayError(message interface{}) Return void | ||
``` | ||
|
||
### mysql_connection.go | ||
|
||
```go | ||
ConnectionBDMySQL() Return *sql.DB | ||
``` | ||
|
||
### psql_connection.go | ||
|
||
```go | ||
ConnectionBDPostgreSQL() Return *sql.DB | ||
ConnectionBDPostgreSQLORM() Return (DB *gorm.DB) | ||
``` | ||
|
||
### string.go | ||
|
||
```go | ||
RemoveZerosInLeft(value string) Return string | ||
RemoveSpaceString(value string) Return string | ||
|
@@ -153,17 +173,20 @@ ParseBinToHex(s string) Return string | |
``` | ||
|
||
### struct.go | ||
|
||
```go | ||
CheckIfIdIfNotZero(objetoId int) Return interface{} | ||
``` | ||
|
||
### try_catch.go | ||
|
||
```go | ||
Throw(up Exception) Return void | ||
(tcf Block) Do() Return void | ||
``` | ||
|
||
### validacoes.go | ||
|
||
```go | ||
MaskCard6Initials(cardString string) Return string | ||
MaskLastDigits(card string) Return string | ||
|
@@ -173,6 +196,7 @@ ValidateTelephone(telefone string) Return string | |
``` | ||
|
||
### zip.go | ||
|
||
```go | ||
ZipFiles(filename string, files []string) Return error | ||
AddFileToZip(zipWriter *zip.Writer, filename string) Return error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters