Documentation ¶
Index ¶
- Constants
- func AcquireFileLock(filePath string) (*fslock.Lock, error)
- func AppendDataInFile(filePath string, data []byte, makeDir bool) error
- func AppendDataToFile(filePath string, data []byte, makeDir bool) (startOffset int64, dataSize int, err error)
- func AppendFile(filename string, text string) (int, error)
- func AtomicReplaceFile(source, destination string) error
- func CleanPath(path string) string
- func CloseFilePointer(filePath string) error
- func CopyDir(source string, dest string) (err error)
- func CopyFile(source, destination string, makeDir bool) (int64, error)
- func CreateDirectory(directoryPath string) error
- func CreateDirectoryRecursive(directoryPath string) error
- func DeleteDirectory(directoryPath string) error
- func DeleteFile(filePath string) error
- func FastReadFile(filePath string) ([]byte, error)
- func FastWriteFile(filePath string, data []byte, makeDir bool, createBackup bool, safeMode bool) error
- func FileAvailabilityCheck(filePath string) bool
- func FileInfo(path string) (os.FileInfo, error)
- func Init(taskCount, concurrency int)
- func ListDirectory(directoryPath string) ([]os.FileInfo, error)
- func ListFileRecursively(path string) ([]string, error)
- func MoveDirectory(source, destination string) error
- func MoveFile(source, destination string) error
- func MoveFileToOtherHost(source, destination string) error
- func MoveFolderToOtherHost(source, destination string) error
- func Open(name string) (*os.File, error)
- func OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
- func ReadFile(filePath string) ([]byte, error)
- func ReadFileFromOffset(f *os.File, startOffset int64, dataSize int64) ([]byte, error)
- func ReadFileUsingFp(fp *os.File) ([]byte, error)
- func ReleaseFileLock(lock *fslock.Lock) error
- func RenameFile(oldFilePath, newFilePath string) error
- func ReplaceFile(data []byte, destination string, createBackup bool) error
- func SetBackPath(folderPath, dbFolderPath string) error
- func TruncateFile(path string, size int64) error
- func UnZipBytes(compressedData []byte) ([]byte, error)
- func UnZipSingleFile(sourceFilePath, destFilePath string) error
- func Unzip(archive, target string) error
- func Walk(root string, walkFunc WalkFunc) error
- func WriteFile(filePath string, data []byte, makeDir bool, createBackup bool) error
- func WriteFileAtOffset(f *os.File, startOffset int64, bytesToWrite []byte) (int64, error)
- func WriteFileUsingFp(f *os.File, data []byte, makeDir bool, createBackup bool) error
- func Zip(source, target string) error
- func ZipBytes(inputData []byte) ([]byte, error)
- func ZipSingleFile(sourceFilePath, destFilePath string) error
- func ZipWithFileList(sources []string, target string) error
- func ZipWithFileListAndSkips(sources []string, target string, skipFileList []string) error
- func ZipWithSkipFileList(source, target string, skipFileList []string) error
- func ZipWithoutBaseDirectory(source, target string) error
- type FileHelperServiceObject
- type Filemdl
- type WalkFunc
Constants ¶
const (
// TempDir - Serves as tmp directory for atomic file operations
TempDir = "tmp"
)
Variables ¶
This section is empty.
Functions ¶
func AcquireFileLock ¶
AcquireFileLock -
func AppendDataInFile ¶
AppendDataInFile - AppendDataInFile
func AppendDataToFile ¶
func AppendDataToFile(filePath string, data []byte, makeDir bool) (startOffset int64, dataSize int, err error)
AppendDataToFile - AppendDataToFile
func AppendFile ¶
AppendFile appends provided data/text to file
func AtomicReplaceFile ¶
AtomicReplaceFile atomically replaces the destination file or directory with the source. It is guaranteed to either replace the target file entirely, or not change either file.
func CloseFilePointer ¶
CloseFilePointer - CloseFilePointer
func CreateDirectory ¶
CreateDirectory creates directory using provided path
func CreateDirectoryRecursive ¶
CreateDirectoryRecursive creates directory recursively using provided path
func DeleteDirectory ¶
DeleteDirectory creates directory using provided path
func FastReadFile ¶
FastReadFile - reads contents from provided file path with fast read method
func FastWriteFile ¶
func FastWriteFile(filePath string, data []byte, makeDir bool, createBackup bool, safeMode bool) error
FastWriteFile - writes provided bytes to file with fast write method
func FileAvailabilityCheck ¶
FileAvailabilityCheck checks whether file is available at given location
func ListDirectory ¶
ListDirectory returns list of all available components of directory
func ListFileRecursively ¶
ListFileRecursively - returns array of filepath recursively from specified path
func MoveDirectory ¶
MoveDirectory MoveDirectory
func MoveFileToOtherHost ¶
MoveFileToOtherHost MoveFileToOtherHost
func MoveFolderToOtherHost ¶
MoveFolderToOtherHost MoveFolderToOtherHost
func ReadFileFromOffset ¶
ReadFileFromOffset - ReadFileFromOffset
func ReadFileUsingFp ¶
ReadFileUsingFp reads contents from provided file pointer
func RenameFile ¶
RenameFile renames/moves file from old path to new path
func ReplaceFile ¶
ReplaceFile ReplaceFile
func SetBackPath ¶
SetBackPath set backup folder path
func UnZipBytes ¶
UnZipBytes bytes - Decompress
func UnZipSingleFile ¶
UnZipSingleFile - UnZip Single File
func WriteFileAtOffset ¶
WriteFileAtOffset - WriteFileAtOffset
func WriteFileUsingFp ¶
WriteFileUsingFp writes provided bytes to file
func ZipSingleFile ¶
ZipSingleFile - Zip single file
func ZipWithFileList ¶ added in v1.2.6
ZipWithFileList - This function will zip multiple files into one zip file
func ZipWithFileListAndSkips ¶ added in v1.2.6
ZipWithFileListAndSkips - This function will zip multiple files into one zip file and skip the file added in skiplist from zip
func ZipWithSkipFileList ¶
ZipWithSkipFileList This method will skip the file added in skiplist from zip
func ZipWithoutBaseDirectory ¶
ZipWithoutBaseDirectory Zip Without Base Directory
Types ¶
type FileHelperServiceObject ¶
type FileHelperServiceObject struct {
// contains filtered or unexported fields
}
FileHelperServiceObject FileHelperServiceObject must be created while calling FileSearh function
func (*FileHelperServiceObject) FileSearch ¶
func (fileHelperServiceObject *FileHelperServiceObject) FileSearch(fileName, path string) ([]string, error)
FileSearch FileSearch