Documentation ¶
Index ¶
- func CreateFileAll(name string, fileFlag int, filePerm, dirPerm os.FileMode) (*os.File, error)
- func Exists(name string) (bool, os.FileInfo, error)
- func Readdir(dir string, max int) (files []os.FileInfo, err error)
- func Readdirnames(dir string, max int) (names []string, err error)
- func RemoveAllSafer(p string) error
- func RemoveSafer(p string) error
- func ValidateRemove(p string) error
- type DirMatcher
- type DirToFinderMatchFiles
- type FileMatcher
- type Finder
- func (f *Finder) Clear() *Finder
- func (f *Finder) Dir(dirs ...string) *Finder
- func (f *Finder) DirMatcher(matchers ...DirMatcher) *Finder
- func (f *Finder) GetDirMatches() (dirs []FinderFile, err error)
- func (f *Finder) GetDirnameMatches() (*cage_strings.Set, error)
- func (f *Finder) GetFileMatches(fileMatchers ...FileMatcher) (DirToFinderMatchFiles, error)
- func (f *Finder) GetFileObjectMatches(fileMatchers ...FileMatcher) (objs []FinderFile, err error)
- func (f *Finder) GetFilenameMatches(fileMatchers ...FileMatcher) (*cage_strings.Set, error)
- func (f *Finder) WalkHiddenDir(b bool) *Finder
- type FinderFile
- type FinderMatchFiles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFileAll ¶
CreateFileAll calls MkdirAll to ensure all intermediate directories exist prior to creation.
func RemoveAllSafer ¶
func RemoveSafer ¶
func ValidateRemove ¶
Types ¶
type DirMatcher ¶
type DirMatcher func(absName string, files FinderMatchFiles) (bool, error)
type DirToFinderMatchFiles ¶
type DirToFinderMatchFiles map[string]FinderMatchFiles
DirToFinderMatchFiles indexes os.Readdir results by directory absolute path.
type FileMatcher ¶
type FileMatcher func(candidate FinderFile) (bool, error)
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
func (*Finder) DirMatcher ¶
func (f *Finder) DirMatcher(matchers ...DirMatcher) *Finder
func (*Finder) GetDirMatches ¶
func (f *Finder) GetDirMatches() (dirs []FinderFile, err error)
GetDirMatches walks the registered directories and returns a FinderFile element for each sub-directory which satisfies the matcher.
Each registered directory will be included if it also satisfies the matcher.
func (*Finder) GetDirnameMatches ¶
func (f *Finder) GetDirnameMatches() (*cage_strings.Set, error)
GetDirnameMatches walks the registered directories and returns the absolute paths to all sub-directories which satisfy the matcher.
Each registered directory will be included if it also satisfies the matcher.
func (*Finder) GetFileMatches ¶
func (f *Finder) GetFileMatches(fileMatchers ...FileMatcher) (DirToFinderMatchFiles, error)
func (*Finder) GetFileObjectMatches ¶
func (f *Finder) GetFileObjectMatches(fileMatchers ...FileMatcher) (objs []FinderFile, err error)
func (*Finder) GetFilenameMatches ¶
func (f *Finder) GetFilenameMatches(fileMatchers ...FileMatcher) (*cage_strings.Set, error)
func (*Finder) WalkHiddenDir ¶
type FinderFile ¶
type FinderMatchFiles ¶
type FinderMatchFiles map[string]FinderFile
FinderMatchFiles indexes FinderFile results by file absolute path.