Documentation
¶
Index ¶
- func AppendLineAtomic(path string, line string, perm os.FileMode) error
- func ExpandTildePath(path string) (string, error)
- func GetSortaDir() (string, error)
- func HumanReadable(n int64) string
- func WriteFileAtomic(path string, data []byte, perm os.FileMode) error
- type DuplicateStats
- type FileEntry
- type FileOperation
- type FileSystem
- type OSFileSystem
- func (OSFileSystem) IsNotExist(err error) bool
- func (OSFileSystem) MkdirAll(path string, perm os.FileMode) error
- func (OSFileSystem) ReadDir(name string) ([]os.DirEntry, error)
- func (OSFileSystem) Remove(path string) error
- func (OSFileSystem) RemoveAll(path string) error
- func (OSFileSystem) Rename(oldpath, newpath string) error
- func (OSFileSystem) Stat(name string) (os.FileInfo, error)
- type OperationType
- type ProgressEvent
- type SortResult
- type Sorter
- type Transaction
- type TransactionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandTildePath ¶
func GetSortaDir ¶
func HumanReadable ¶
Types ¶
type DuplicateStats ¶
type FileOperation ¶
type FileOperation struct {
OpType OperationType
File FileEntry
DestPath string
Size int64
StagedPath string
}
type FileSystem ¶
type OSFileSystem ¶
type OSFileSystem struct{}
func (OSFileSystem) IsNotExist ¶
func (OSFileSystem) IsNotExist(err error) bool
func (OSFileSystem) Remove ¶
func (OSFileSystem) Remove(path string) error
func (OSFileSystem) RemoveAll ¶
func (OSFileSystem) RemoveAll(path string) error
func (OSFileSystem) Rename ¶
func (OSFileSystem) Rename(oldpath, newpath string) error
type OperationType ¶
type OperationType int
const ( OpMove OperationType = iota OpRename OpDedupe OpDelete OpSkip OpUndo )
type ProgressEvent ¶
type SortResult ¶
func (*SortResult) PrintSummary ¶
func (r *SortResult) PrintSummary()
type Sorter ¶
type Sorter interface {
Decide(ctx context.Context, filePaths []FileEntry) ([]FileOperation, error)
}
type Transaction ¶
type Transaction struct {
ID string
TType TransactionType
Operations []FileOperation
Irreversible bool
}
Click to show internal directories.
Click to hide internal directories.