Documentation
¶
Index ¶
- func Base64ToBytes(s string) []byte
- func Base64ToString(s string) string
- func ByteToBase64(b []byte) string
- func ConvertJsonFieldToSnakeCase(jsonstr string) string
- func CreateDirIfNotExists(dir string) (err error)
- func CreateFile(file []byte, filePath string) (err error)
- func CreateTempFile(file []byte, fileNameExt string) (path string, err error)
- func CreateTextFile(filePath, content string) error
- func CsvStringToMap(fileString string, delimiter rune, upperColumns bool) (r []map[string]string, err error)
- func CsvStringToStruct(fileString string, delimiter rune, quoted bool, dest interface{}) (err error)
- func DecodeISO88591(b string) string
- func DirectotyExists(path string) bool
- func Exists(path string) bool
- func FileBase64ToFile(b64 string, filename string) (err error)
- func FileBase64ToReader(contentBase64 string) *bytes.Reader
- func FileToBase64(filepath string) (result string, err error)
- func FileToString(filename string) string
- func FileUrlToBase64(url string) (result string, err error)
- func FileUrlToLocalfile(url, localpath string) (err error)
- func FileUrlToReader(url string) (result *bytes.Reader, err error)
- func GetBase64Content(b64 string) string
- func GetDir(path string) (dir string)
- func GetFileExtensionFromBase64(strBase64 string) (string, error)
- func GetFileExtensionFromPath(path string) string
- func GetFileListFromDirectory(directoryPath string, recursively bool) ([]string, error)
- func GetFileNameWithExtensionFromPath(path string) string
- func GetFileSizeFromBase64(fileBase64 string) int
- func GetMineTypeFromBase64(strBase64 string) string
- func GetMineTypeFromReader(reader *bytes.Reader) string
- func GetTempPath(filename string) string
- func GetUniqueTempDir() string
- func IsBase64(b64 string) bool
- func IsDirectory(path string) bool
- func RemoveLastDirectoryFromPath(p string) string
- func RemoveXmlVersion(xmlString string) string
- func StringToBase64(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64ToBytes ¶
Base64ToBytes converte uma string em base64 para bytes
func Base64ToString ¶
Base64ToString converte string no formato base64 para string normal
func ByteToBase64 ¶
ByteToBase64 converte arquivo em byte para base64
func CreateDirIfNotExists ¶
CreateDirIfNotExists cria uma diretorio no caminho especificado caso o mesmo nao exista
func CreateFile ¶
func CreateTempFile ¶
CreateTempFile creates a temporary file and returns its path Use fileNameExt to determine the filename along with the extension. EX: file.pdf
func CreateTextFile ¶
CreateTextFile create a text fileUtil, not binary fileUtil
func CsvStringToMap ¶
func CsvStringToMap(fileString string, delimiter rune, upperColumns bool) (r []map[string]string, err error)
CsvStringToMap Convert Csv stringUtil to Map
func CsvStringToStruct ¶
func CsvStringToStruct(fileString string, delimiter rune, quoted bool, dest interface{}) (err error)
CsvStringToStruct converte um arquivo csv no formato de string para uma struct, essa struct passada deve ser uma lista
func DecodeISO88591 ¶
DecodeSO8859_1 funcao para decodificar bytes que possuem acentos, retorna com acento corretamente
func DirectotyExists ¶
DirectotyExists check if directoty exists given a path
func FileBase64ToFile ¶
FileBase64ToFile funcao para salvar uma string de um arquivo em base64 em um arquivo o disco e no caminho especificado no parametro `filename`
func FileBase64ToReader ¶
FileBase64ToReader convert string in base64 to Reader interface
func FileToBase64 ¶
FileToBase64 function to convert a local fileUtil into base64
func FileToString ¶
FileToString convert text fileUtil to string
func FileUrlToBase64 ¶
FileUrlToBase64 faz o download de um arquivo dado uma url e retorna o mesmo no formato base64
func FileUrlToLocalfile ¶
FileUrlToLocalfile faz o download de um arquivo dado uma url e salva no caminho passado como parametro
func FileUrlToReader ¶
FileUrlToReader faz o download de um arquivo dado uma url e retorna um objeto do tipo `bytes.Reader`
func GetBase64Content ¶
GetBase64Content essa funcao remove os dados sobre o base64 da string, quando converte para base 64, ele pode retornar com fragmento dizendo o tipo de arquivo e isso nao é válido para criar um arquivo
func GetDir ¶
GetDir retorna o diretorio dado um caminho, ja retorna com o slash compativel com o sistema operacional
func GetFileExtensionFromBase64 ¶
getMineTypeFromReader get the Mine type from reader
func GetFileExtensionFromPath ¶
GetFileExtensionFromPath retorna a extensao do aruivo dado um determinado path
func GetFileListFromDirectory ¶
GetFileListFromDirectory returns slice/list of the files within the path passed by parameter, specify if it will returns recursively or not
func GetFileNameWithExtensionFromPath ¶
GetFileNameWithExtensionFromPath retorna o nome do arquivo com a extensao dado um determinado path
func GetFileSizeFromBase64 ¶
GetFileSizeFromBase64 get the file size of the base64 string, return the int value what represents the size in KB
func GetMineTypeFromBase64 ¶
getMineTypeFromReader get the file Mine type from string base64 format
func GetMineTypeFromReader ¶
getMineTypeFromReader get the Mine type from reader
func GetTempPath ¶
GetTempPath retorna um diretorio temporário junto com o nome do arquivo passado como parametro
func GetUniqueTempDir ¶
func GetUniqueTempDir() string
GetUniqueTempDir retorna um diretorio temporário(com o path compatível com o OS) adicionado de uma string que o deixa único
func IsDirectory ¶
IsDirectory check if the path is a directory or not
func RemoveLastDirectoryFromPath ¶
RemoveLastDirectoryFromPath remove o ultimo diretorio de um caminho especificado no parametro
func RemoveXmlVersion ¶
removeXmlVersion remove a string da versao do xml, pois quando gera esta vindo essa string
Types ¶
This section is empty.