Documentation ¶
Index ¶
- Variables
- type Entry
- type FileFilter
- func FilterIgnoreHiddenFile() FileFilter
- func FilterIgnoreNameTableOfFile(names ...string) FileFilter
- func FilterIgnorePrefixTableOfFile(prefix ...string) FileFilter
- func FilterIgnorePrefixTableOfPath(prefix ...string) FileFilter
- func FilterIgnoreRegexOfPath(strRegexMatch string) FileFilter
- func FilterMatchRegexOfPath(strRegexMatch string) FileFilter
- type IScanEntry
- type IScanResult
- type IScanner
- type ScanResult
- func (sr *ScanResult) CalculateSha1(errorHandler func(path string, err error)) *ScanResult
- func (sr *ScanResult) CalculateSha1Concurrently(concurrent int, errorHandler func(path string, err error)) *ScanResult
- func (sr *ScanResult) FireNew() (IScanResult, error)
- func (sr *ScanResult) Get(path string) IScanEntry
- func (sr *ScanResult) GetChildrenTable() map[string][]string
- func (sr *ScanResult) GetPaths() []string
- func (sr *ScanResult) GetRoot() string
- func (sr *ScanResult) Len() int
- func (sr *ScanResult) RangeDirs(fn func(pth string, se IScanEntry) error) error
- func (sr *ScanResult) RangeFiles(fn func(pth string, se IScanEntry) error) error
- func (sr *ScanResult) UsingRelativePath() bool
- func (sr *ScanResult) WarmUp()
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RecommendedConcurrent = runtime.GOMAXPROCS(0) - 1
)
Functions ¶
This section is empty.
Types ¶
type FileFilter ¶
* FileFilter is a function that determine is a file met some conditions. * * the `info` param can be null when `os.Lstat` of the given path failed * the `err` param will be passed to `path/filepath.Walk`
func FilterIgnoreHiddenFile ¶
func FilterIgnoreHiddenFile() FileFilter
func FilterIgnoreNameTableOfFile ¶
func FilterIgnoreNameTableOfFile(names ...string) FileFilter
func FilterIgnorePrefixTableOfFile ¶
func FilterIgnorePrefixTableOfFile(prefix ...string) FileFilter
btw. redix-tree can handle a large scale of prefix matching
func FilterIgnorePrefixTableOfPath ¶
func FilterIgnorePrefixTableOfPath(prefix ...string) FileFilter
func FilterIgnoreRegexOfPath ¶
func FilterIgnoreRegexOfPath(strRegexMatch string) FileFilter
func FilterMatchRegexOfPath ¶
func FilterMatchRegexOfPath(strRegexMatch string) FileFilter
type IScanEntry ¶
type IScanResult ¶
type IScanResult interface { IScanner Len() int UsingRelativePath() bool Get(path string) IScanEntry GetPaths() []string RangeFiles(fn func(pth string, se IScanEntry) error) error RangeDirs(fn func(pth string, se IScanEntry) error) error WarmUp() GetChildrenTable() map[string][]string }
func NewAndScan ¶
func NewAndScan(searchingRoot string, usingRelativePath bool, middleWares ...FileFilter) (IScanResult, error)
func NewEmpty ¶
func NewEmpty(searchingRoot string, usingRelativePath bool, middleWares ...FileFilter) (IScanResult, error)
type IScanner ¶
type IScanner interface { GetRoot() string FireNew() (IScanResult, error) }
type ScanResult ¶
type ScanResult struct { Paths []string // contains filtered or unexported fields }
func (*ScanResult) CalculateSha1 ¶
func (sr *ScanResult) CalculateSha1(errorHandler func(path string, err error)) *ScanResult
func (*ScanResult) CalculateSha1Concurrently ¶
func (sr *ScanResult) CalculateSha1Concurrently(concurrent int, errorHandler func(path string, err error)) *ScanResult
func (*ScanResult) FireNew ¶
func (sr *ScanResult) FireNew() (IScanResult, error)
FireNew :: immutable - to create a new scan result with given sr
func (*ScanResult) Get ¶
func (sr *ScanResult) Get(path string) IScanEntry
func (*ScanResult) GetChildrenTable ¶
func (sr *ScanResult) GetChildrenTable() map[string][]string
func (*ScanResult) GetPaths ¶
func (sr *ScanResult) GetPaths() []string
func (*ScanResult) GetRoot ¶
func (sr *ScanResult) GetRoot() string
func (*ScanResult) Len ¶
func (sr *ScanResult) Len() int
func (*ScanResult) RangeDirs ¶
func (sr *ScanResult) RangeDirs(fn func(pth string, se IScanEntry) error) error
func (*ScanResult) RangeFiles ¶
func (sr *ScanResult) RangeFiles(fn func(pth string, se IScanEntry) error) error
func (*ScanResult) UsingRelativePath ¶
func (sr *ScanResult) UsingRelativePath() bool
Click to show internal directories.
Click to hide internal directories.