Versions in this module Expand all Collapse all v0 v0.0.1 May 24, 2023 Changes in this version + func GetGroup(gid uint32) string + func GetMimeType(path string) string + func GetSymlink(path string) string + func GetUsername(uid uint32) string + func IsHidden(path string) bool + func IsSymlink(mode os.FileMode) bool + func ScanDir(fs afero.Fs, path string, dirMap *sync.Map, wg *sync.WaitGroup) + func ZipFile(files []archiver.File, dst afero.File) error + type CompressType string + const Bz2 + const Gz + const Tar + const TarGz + const Xz + const Zip + type FileInfo struct + Content string + Extension string + FileMode os.FileMode + Fs afero.Fs + Group string + IsDir bool + IsHidden bool + IsSymlink bool + ItemTotal int + Items []*FileInfo + LinkPath string + MimeType string + ModTime time.Time + Mode string + Name string + Path string + Size int64 + Type string + UpdateTime time.Time + User string + func NewFileInfo(op FileOption) (*FileInfo, error) + type FileOp struct + Fs afero.Fs + func NewFileOp() FileOp + func (f FileOp) Backup(srcFile string) (string, error) + func (f FileOp) Chmod(dst string, mode fs.FileMode) error + func (f FileOp) ChmodR(dst string, mode int64) error + func (f FileOp) Chown(dst string, uid int, gid int) error + func (f FileOp) ChownR(dst string, uid string, gid string, sub bool) error + func (f FileOp) Compress(srcRiles []string, dst string, name string, cType CompressType) error + func (f FileOp) Copy(src, dst string) error + func (f FileOp) CopyAndBackup(src string) (string, error) + func (f FileOp) CopyDir(src, dst string) error + func (f FileOp) CopyFile(src, dst string) error + func (f FileOp) CreateDir(dst string, mode fs.FileMode) error + func (f FileOp) CreateFile(dst string) error + func (f FileOp) Cut(oldPaths []string, dst string) error + func (f FileOp) Decompress(srcFile string, dst string, cType CompressType) error + func (f FileOp) DeleteDir(dst string) error + func (f FileOp) DeleteFile(dst string) error + func (f FileOp) DownloadFile(url, dst string) error + func (f FileOp) DownloadFileWithProcess(url, dst, key string) error + func (f FileOp) GetContent(dst string) ([]byte, error) + func (f FileOp) GetDirSize(path string) (float64, error) + func (f FileOp) LinkFile(source string, dst string, isSymlink bool) error + func (f FileOp) OpenFile(dst string) (fs.File, error) + func (f FileOp) Rename(oldName string, newName string) error + func (f FileOp) SaveFile(dst string, content string, mode fs.FileMode) error + func (f FileOp) Stat(dst string) bool + func (f FileOp) WriteFile(dst string, in io.Reader, mode fs.FileMode) error + type FileOption struct + ContainSub bool + Dir bool + Expand bool + Page int + PageSize int + Path string + Search string + ShowHidden bool + type FileSearchInfo struct + Path string + type Process struct + Name string + Percent float64 + Total uint64 + Written uint64 + type WriteCounter struct + Key string + Name string + Total uint64 + Written uint64 + func (w *WriteCounter) SaveProcess() + func (w *WriteCounter) Write(p []byte) (n int, err error)