Documentation ¶
Index ¶
- func DetectBinary(buf []byte) bool
- func GetGroup(gid uint32) string
- func GetMimeType(path string) string
- func GetParentMode(path string) (os.FileMode, error)
- func GetSymlink(path string) string
- func GetUsername(uid uint32) string
- func IsBlockDevice(mode os.FileMode) bool
- func IsEmptyDir(dir string) bool
- func IsHidden(path string) bool
- func IsInvalidChar(name string) bool
- func IsSymlink(mode os.FileMode) bool
- func ReadFileByLine(filename string, page, pageSize int, latest bool) (lines []string, isEndOfFile bool, total int, err error)
- func ZipFile(files []archiver.File, dst afero.File) error
- type CompressType
- type FileInfo
- type FileOp
- func (f FileOp) ChmodR(dst string, mode int64, sub bool) error
- func (f FileOp) ChmodRWithMode(dst string, mode fs.FileMode, sub bool) error
- func (f FileOp) ChownR(dst string, uid string, gid string, sub bool) error
- func (f FileOp) CleanDir(dst string) error
- func (f FileOp) Compress(srcRiles []string, dst string, name string, cType CompressType, secret string) error
- func (f FileOp) Copy(src, dst string) error
- func (f FileOp) CopyAndReName(src, dst, name string, cover bool) 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) CreateDirWithMode(dst string, mode fs.FileMode) error
- func (f FileOp) CreateFile(dst string) error
- func (f FileOp) CreateFileWithMode(dst string, mode fs.FileMode) error
- func (f FileOp) Cut(oldPaths []string, dst, name string, cover bool) error
- func (f FileOp) Decompress(srcFile string, dst string, cType CompressType, secret string) 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, ignoreCertificate bool) error
- func (f FileOp) DownloadFileWithProxy(url, dst 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) Mv(oldPath, dstPath string) error
- func (f FileOp) OpenFile(dst string) (fs.File, error)
- func (f FileOp) Rename(oldName string, newName string) error
- func (f FileOp) RmRf(dst string) error
- func (f FileOp) SaveFile(dst string, content string, mode fs.FileMode) error
- func (f FileOp) SaveFileWithByte(dst string, content []byte, 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
- type FileSearchInfo
- type Process
- type ShellArchiver
- type TarArchiver
- type TarGzArchiver
- type WriteCounter
- type ZipArchiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectBinary ¶ added in v1.8.0
func GetMimeType ¶
func GetSymlink ¶
func GetUsername ¶ added in v1.2.0
func IsBlockDevice ¶
func IsEmptyDir ¶
func IsInvalidChar ¶
func ReadFileByLine ¶ added in v1.6.0
Types ¶
type CompressType ¶
type CompressType string
const ( Zip CompressType = "zip" Gz CompressType = "gz" Bz2 CompressType = "bz2" Tar CompressType = "tar" TarGz CompressType = "tar.gz" Xz CompressType = "xz" SdkZip CompressType = "sdkZip" SdkTarGz CompressType = "sdkTarGz" )
type FileInfo ¶
type FileInfo struct { Fs afero.Fs `json:"-"` Path string `json:"path"` Name string `json:"name"` User string `json:"user"` Group string `json:"group"` Uid string `json:"uid"` Gid string `json:"gid"` Extension string `json:"extension"` Content string `json:"content"` Size int64 `json:"size"` IsDir bool `json:"isDir"` IsSymlink bool `json:"isSymlink"` IsHidden bool `json:"isHidden"` LinkPath string `json:"linkPath"` Type string `json:"type"` Mode string `json:"mode"` MimeType string `json:"mimeType"` UpdateTime time.Time `json:"updateTime"` ModTime time.Time `json:"modTime"` FileMode os.FileMode `json:"-"` Items []*FileInfo `json:"items"` ItemTotal int `json:"itemTotal"` FavoriteID uint `json:"favoriteID"` IsDetail bool `json:"isDetail"` }
func NewFileInfo ¶
func NewFileInfo(op FileOption) (*FileInfo, error)
type FileOp ¶
func (FileOp) ChmodRWithMode ¶
func (FileOp) CopyAndReName ¶ added in v1.8.0
func (FileOp) CreateDirWithMode ¶
func (FileOp) CreateFile ¶
func (FileOp) CreateFileWithMode ¶
func (FileOp) Decompress ¶
func (FileOp) DeleteFile ¶
func (FileOp) DownloadFile ¶
func (FileOp) DownloadFileWithProcess ¶
func (FileOp) DownloadFileWithProxy ¶
func (FileOp) SaveFileWithByte ¶
type FileOption ¶
type FileOption struct { Path string `json:"path"` Search string `json:"search"` ContainSub bool `json:"containSub"` Expand bool `json:"expand"` Dir bool `json:"dir"` ShowHidden bool `json:"showHidden"` Page int `json:"page"` PageSize int `json:"pageSize"` SortBy string `json:"sortBy"` SortOrder string `json:"sortOrder"` IsDetail bool `json:"isDetail"` }
type FileSearchInfo ¶
type ShellArchiver ¶ added in v1.8.0
type ShellArchiver interface { Extract(filePath, dstDir string, secret string) error Compress(sourcePaths []string, dstFile string, secret string) error }
func NewShellArchiver ¶ added in v1.8.0
func NewShellArchiver(compressType CompressType) (ShellArchiver, error)
func NewTarArchiver ¶ added in v1.8.0
func NewTarArchiver(compressType CompressType) ShellArchiver
func NewTarGzArchiver ¶
func NewTarGzArchiver() ShellArchiver
func NewZipArchiver ¶ added in v1.8.0
func NewZipArchiver() ShellArchiver
type TarArchiver ¶ added in v1.8.0
type TarArchiver struct { Cmd string CompressType CompressType }
type TarGzArchiver ¶
type TarGzArchiver struct { }
type WriteCounter ¶
func (*WriteCounter) SaveProcess ¶
func (w *WriteCounter) SaveProcess()
type ZipArchiver ¶ added in v1.8.0
type ZipArchiver struct { }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.