Versions in this module Expand all Collapse all v0 v0.0.47 Oct 31, 2023 v0.0.46 Oct 1, 2023 Changes in this version + var DefaultFilePermission = os.FileMode(0644) + var ErrInvalidSeparator = errors.New("invalid separator") + var IsNotEmpty = func(data []byte) bool + var SkipEmptyLine = func(line []byte) bool + func CleanPath(inputPath string) (string, error) + func CleanPathOrDefault(inputPath string, defaultPath 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 FileExistsIn(file string, allowedPaths ...string) (string, error) + func FileOrFolderExists(name string) bool + func FileSizeToByteLen(fileSize string) (int, error) + func FixMissingDirs(path string) error + func FolderExists(foldername string) bool + 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 OpenOrCreateFile(name string) (*os.File, 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 ResolveNClean(inputPath string, baseDir ...string) (string, error) + func ResolveNCleanOrDefault(inputPath string, defaultPath string, baseDir ...string) string + func SafeOpen(path string) (*os.File, error) + func SafeOpenAppend(path string) (*os.File, error) + func SafeOpenWrite(path string) (*os.File, error) + func SafeWriteFile(path string, data []byte) error + func SubstituteConfigFromEnvVars(filepath string) (io.Reader, 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 uint8 + const JSON + const YAML + type FileFilters struct + Callback func(filename string) error + CustomCheck func(filename string) bool + OlderThan time.Duration + Prefix string + RegexPattern string + Suffix string