Documentation
¶
Index ¶
Constants ¶
View Source
const ( OccurenceGroupTypeContent = iota OccurenceGroupTypePath = iota )
Types of occurence group types.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Occurence ¶
type Occurence struct { Casing casing.Casing Match string Line string StartIndex int LineStartIndex int SurroundingLinesBefore []string SurroundingLinesAfter []string LineNumber int }
Occurence is an occurence of the search text in a file.
type OccurenceGroup ¶
type OccurenceGroup struct { Path string Occurences Occurences Type OccurenceGroupType }
OccurenceGroup is a grouping of occurences by file path and type.
func (OccurenceGroup) String ¶
func (g OccurenceGroup) String() string
type OccurenceGroupType ¶
type OccurenceGroupType uint8
OccurenceGroupType determines what kind of occurence group it is.
type OccurenceGroups ¶
type OccurenceGroups []*OccurenceGroup
OccurenceGroups is a list of occurence groups. When sorted, files come first.
func ScanFileNodes ¶
func ScanFileNodes(nodes lister.FileNodes, needle string, binaryPattern string) (OccurenceGroups, error)
ScanFileNodes will scan files and folders for occurences of the specified string.
func (OccurenceGroups) Len ¶
func (slice OccurenceGroups) Len() int
func (OccurenceGroups) String ¶
func (slice OccurenceGroups) String() string
func (OccurenceGroups) Swap ¶
func (slice OccurenceGroups) Swap(i int, j int)
type Occurences ¶
type Occurences []*Occurence
Occurences is a slice of occurences.
func ScanFile ¶
func ScanFile(filePath string, variants casing.Variants) (Occurences, error)
ScanFile scans a single file and returns the occurences of the specified variants.
func ScanFilePath ¶
func ScanFilePath(filePath string, variants casing.Variants) Occurences
ScanFilePath scans a file path name for occurences.
func (Occurences) Len ¶
func (slice Occurences) Len() int
func (Occurences) Less ¶
func (slice Occurences) Less(i, j int) bool
func (Occurences) Swap ¶
func (slice Occurences) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.