Documentation ¶
Index ¶
- Constants
- Variables
- func BufferWriteAppend(file *os.File, content string) error
- func CombineNewFilename(srcFile, destFile, delimiter string) string
- func CopyFile(src, dst string) error
- func CountLines(filename string) (uint, error)
- func CountLinesWithOptions(reader io.Reader, separator []byte, filter func([]byte) bool) (uint, error)
- func CountLinesWithSeparator(separator []byte, filename string) (uint, error)
- func CreateFolder(path string) error
- func CreateFolders(paths ...string) error
- func DeleteFilesOlderThan(folder string, filter FileFilters) error
- func DownloadFile(filepath string, url string) error
- func ExecutableName() string
- func FileExists(filename string) bool
- func FileOrFolderExists(name string) bool
- func FolderExists(foldername string) bool
- func GetFilename(srcFile string) string
- func GetTempFileName() (string, error)
- func HasPermission(fileName string, permission int) (bool, error)
- func HasStdin() bool
- func IsReadable(fileName string) (bool, error)
- func IsWriteable(fileName string) (bool, error)
- func Marshal(encodeType EncodeType, data []byte, obj interface{}) error
- func MarshalToWriter(encodeType EncodeType, r io.Writer, obj interface{}) error
- func ReadFile(filename string) (chan string, error)
- func ReadFileWithBufferSize(filename string, maxCapacity int) (chan string, error)
- func ReadFileWithReader(r io.Reader) (chan string, error)
- func ReadFileWithReaderAndBufferSize(r io.Reader, maxCapacity int) (chan string, error)
- func RemoveAll(paths ...string) (errored map[string]error)
- func Unmarshal(encodeType EncodeType, data []byte, obj interface{}) error
- func UnmarshalFromReader(encodeType EncodeType, r io.Reader, obj interface{}) error
- func UseMusl(path string) (bool, error)
- type EncodeType
- type FileFilters
- type FileType
Constants ¶
View Source
const ( FILE_TXT = iota FILE_JSON FILE_CSV NOT_FOUND )
Variables ¶
View Source
var ErrInvalidSeparator = errors.New("invalid separator")
View Source
var IsNotEmpty = func(data []byte) bool { return len(data) > 0 }
IsNotEmpty determines if a data chunk is empty
View Source
var SkipEmptyLine = func(line []byte) bool { return len(line) > 0 }
Functions ¶
func CombineNewFilename ¶
func CountLines ¶
CountLines counts the lines in a file
func CountLinesWithOptions ¶
func CountLinesWithOptions(reader io.Reader, separator []byte, filter func([]byte) bool) (uint, error)
CountLinesWithOptions from a reader and custom filter function
func CountLinesWithSeparator ¶
CountLinesWithSeparator of a file
func DeleteFilesOlderThan ¶
func DeleteFilesOlderThan(folder string, filter FileFilters) error
func DownloadFile ¶
DownloadFile to specified path
func ExecutableName ¶
func ExecutableName() string
func FileExists ¶
FileExists checks if the file exists in the provided path
func FileOrFolderExists ¶
FileOrFolderExists checks if the file/folder exists
func FolderExists ¶
FolderExists checks if the folder exists
func GetFilename ¶
func GetTempFileName ¶
GetTempFileName generate a temporary file name
func HasPermission ¶
HasPermission checks if the file has the requested permission
func IsWriteable ¶
IsWriteable verify file writeability
func Marshal ¶
func Marshal(encodeType EncodeType, data []byte, obj interface{}) error
func MarshalToWriter ¶
func MarshalToWriter(encodeType EncodeType, r io.Writer, obj interface{}) error
func ReadFileWithBufferSize ¶
ReadFile with filename and specific buffer size
func ReadFileWithReader ¶
ReadFileWithReader and stream on a channel
func ReadFileWithReaderAndBufferSize ¶
ReadFileWithReader with specific buffer size and stream on a channel
func Unmarshal ¶
func Unmarshal(encodeType EncodeType, data []byte, obj interface{}) error
func UnmarshalFromReader ¶
func UnmarshalFromReader(encodeType EncodeType, r io.Reader, obj interface{}) error
Types ¶
type FileFilters ¶
Click to show internal directories.
Click to hide internal directories.