Documentation
¶
Index ¶
- type FSFinderOptions
- func WithDepth(depthVal int) FSFinderOptions
- func WithExcludeDirs(excludeDirs []string) FSFinderOptions
- func WithExcludeFileTypes(types []string) FSFinderOptions
- func WithFileTypes(fileTypes []filetype.FileType) FSFinderOptions
- func WithPathRoots(paths ...string) FSFinderOptions
- func WithTypeOverrides(overrides []TypeOverride) FSFinderOptions
- type FileFinder
- type FileMetadata
- type FileSystemFinder
- type TypeOverride
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSFinderOptions ¶
type FSFinderOptions func(*FileSystemFinder)
func WithDepth ¶
func WithDepth(depthVal int) FSFinderOptions
WithDepth adds the depth for search recursion to FSFinder
func WithExcludeDirs ¶
func WithExcludeDirs(excludeDirs []string) FSFinderOptions
Add a custom list of file types to the FSFinder
func WithExcludeFileTypes ¶
func WithExcludeFileTypes(types []string) FSFinderOptions
WithExcludeFileTypes adds excluded file types to FSFinder.
func WithFileTypes ¶
func WithFileTypes(fileTypes []filetype.FileType) FSFinderOptions
Add a custom list of file types to the FSFinder
func WithTypeOverrides ¶
func WithTypeOverrides(overrides []TypeOverride) FSFinderOptions
WithTypeOverrides adds glob pattern to file type mappings
type FileFinder ¶
type FileFinder interface {
Find() ([]FileMetadata, error)
}
Find will return an array of FileMetadata objects from a provided path and array of FileTypes. Any files in subdirectories defined in excludeDirs will not be returned
type FileMetadata ¶
The File Metadata object stores the name and the path of the file and the type of file that it is, example: json, yml, etc
type FileSystemFinder ¶
type FileSystemFinder struct {
PathRoots []string
FileTypes []filetype.FileType
ExcludeDirs map[string]struct{}
ExcludeFileTypes map[string]struct{}
Depth *int
TypeOverrides []TypeOverride
}
func FileSystemFinderInit ¶
func FileSystemFinderInit(opts ...FSFinderOptions) *FileSystemFinder
func (FileSystemFinder) Find ¶
func (fsf FileSystemFinder) Find() ([]FileMetadata, error)
Find implements the FileFinder interface by calling findOne on all the PathRoots and providing the aggregated FileMetadata after ignoring all the duplicate files