Documentation ¶
Index ¶
- Variables
- func FindFiles(path string, filter FilePathFilterer) <-chan string
- func Search(path string, filter FilePathFilterer, matcher LineMatcher) <-chan SearchResult
- func SearchFiles(files <-chan string, matcher LineMatcher) <-chan SearchResult
- type FileFilterer
- type FilePathFilterer
- type GlobInclExclFilter
- type LineMatcher
- type PathFilterer
- type RegexInclExclFilter
- type RegexpLineMatcher
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
var Workers = 5
Workers is the number of workers that Search will use when reading files.
Functions ¶
func FindFiles ¶
func FindFiles(path string, filter FilePathFilterer) <-chan string
FindFiles takes a path and returns a string of all files that match the search params
func Search ¶
func Search(path string, filter FilePathFilterer, matcher LineMatcher) <-chan SearchResult
Search is a combination call to FindFiles and SearchFiles, noteworthy that this function will create several workers for SearchFiles.
func SearchFiles ¶
func SearchFiles(files <-chan string, matcher LineMatcher) <-chan SearchResult
SearchFiles takes a channel of paths, and searches for the regex in each file for the path.
Types ¶
type FileFilterer ¶
FileFilterer is an interface that determines if a file should be included or not.
type FilePathFilterer ¶
type FilePathFilterer interface { PathFilterer FileFilterer }
FilePathFilterer is an interface that determines if a paths and files should be included.
type GlobInclExclFilter ¶
GlobInclExclFilter is a filter that uses glob strings to include files matched by IncludedFiles, and prune paths matched by ExcludedPaths.
func (GlobInclExclFilter) FilterFile ¶
func (f GlobInclExclFilter) FilterFile(path string) bool
func (GlobInclExclFilter) FilterPath ¶
func (f GlobInclExclFilter) FilterPath(path string) bool
type LineMatcher ¶
LineMatcher is an interface that checks if a line should be included.
type PathFilterer ¶
PathFilterer is an interface that determines if a path should be searched or skipped.
type RegexInclExclFilter ¶
RegexInclExclFilter is a filter that uses regular expressions to include files matched by IncludedFiles, and prune paths matched by ExcludedPaths.
func (RegexInclExclFilter) FilterFile ¶
func (f RegexInclExclFilter) FilterFile(path string) bool
func (RegexInclExclFilter) FilterPath ¶
func (f RegexInclExclFilter) FilterPath(path string) bool
type RegexpLineMatcher ¶
func (*RegexpLineMatcher) Match ¶
func (m *RegexpLineMatcher) Match(line string) bool