Documentation
¶
Index ¶
- Constants
- type DirTraverse
- func (t *DirTraverse) Cancel()
- func (t *DirTraverse) Close() error
- func (t *DirTraverse) Errors() []error
- func (t *DirTraverse) GetAllPath(opts ...Option) ([]string, error)
- func (t *DirTraverse) Handle(opts ...Option) error
- func (t *DirTraverse) HasErrors() bool
- func (t *DirTraverse) SetOption(opts ...Option)
- func (t *DirTraverse) WaitOver()
- type FileCountRes
- type FileListRes
- type Option
- func WithDefaultExclude() Option
- func WithDepth(depth int) Option
- func WithExcludeDir(exclude []string) Option
- func WithExcludePrefix(list ...string) Option
- func WithExcludeSuffix(list ...string) Option
- func WithExcludeUnknown(exclude bool) Option
- func WithOnlyDir() Option
- func WithProgressBarOut() Option
- func WithSyncFileOpMode() Option
- func WithSyncMode() Option
- func WithTargetExt(ext string) Option
- func WithWorkerCount(count int) Option
- type Sheet
- type TraverseItem
- type WorkSheet
Constants ¶
View Source
const ( ItemAddStat = iota ItemOverStat )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirTraverse ¶
type DirTraverse struct {
Path string
Over chan struct{}
WorkSheet *WorkSheet
ProcessFunc func(item *TraverseItem) // 重命名:Fc -> ProcessFunc
// contains filtered or unexported fields
}
func NewDirTraverse ¶
func NewDirTraverse(p string, processFunc func(item *TraverseItem), opts ...Option) *DirTraverse
func (*DirTraverse) Errors ¶ added in v0.0.5
func (t *DirTraverse) Errors() []error
Errors 返回遍历过程中收集的所有错误
func (*DirTraverse) GetAllPath ¶
func (t *DirTraverse) GetAllPath(opts ...Option) ([]string, error)
func (*DirTraverse) Handle ¶
func (t *DirTraverse) Handle(opts ...Option) error
func (*DirTraverse) HasErrors ¶ added in v0.0.5
func (t *DirTraverse) HasErrors() bool
HasErrors 检查是否有错误
func (*DirTraverse) SetOption ¶
func (t *DirTraverse) SetOption(opts ...Option)
func (*DirTraverse) WaitOver ¶
func (t *DirTraverse) WaitOver()
type FileCountRes ¶
type FileCountRes struct {
Count int
TargetCount int
CountMap map[string]int
// contains filtered or unexported fields
}
func GetFileCount ¶
func GetFileCount(dir string, opts ...Option) (*FileCountRes, error)
type FileListRes ¶
type FileListRes struct {
List []string
Map map[string]struct{}
// contains filtered or unexported fields
}
func GetFileList ¶
func GetFileList(dir string, opts ...Option) (*FileListRes, error)
type Option ¶
type Option func(o *option)
func WithDefaultExclude ¶
func WithDefaultExclude() Option
func WithExcludeDir ¶
func WithExcludePrefix ¶
func WithExcludeSuffix ¶
func WithExcludeUnknown ¶
func WithOnlyDir ¶
func WithOnlyDir() Option
func WithProgressBarOut ¶
func WithProgressBarOut() Option
func WithSyncFileOpMode ¶
func WithSyncFileOpMode() Option
func WithSyncMode ¶
func WithSyncMode() Option
func WithTargetExt ¶
func WithWorkerCount ¶
type TraverseItem ¶
Click to show internal directories.
Click to hide internal directories.