Documentation
¶
Index ¶
Constants ¶
View Source
const ( NothingDetected Finding = 0 ClassName = 1 << iota JarName = 1 << iota JarNameInsideArchive = 1 << iota ClassPackageAndName = 1 << iota ClassFileMd5 = 1 << iota )
View Source
const (
UnknownVersion = "unknown"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crawler ¶
Crawler crawls filesystems, matching and conditionally processing files.
func (Crawler) Crawl ¶
func (c Crawler) Crawl(ctx context.Context, root string, match MatchFunc, process ProcessFunc) error
Crawl crawls the provided root directory. Each file is passed to the provided match function, which returns true if the path should be processed by the provided process function. On encountering a directory, the path will be compared against all IgnoreDirs configured in the Crawler. If any pattern matches, the directory (and all files nested inside the directory) will be ignored.
type Identifier ¶
type Identifier interface {
Identify(ctx context.Context, path string, d fs.DirEntry) (Finding, Versions, error)
}
func NewIdentifier ¶
func NewIdentifier(archiveListTimeout time.Duration, zipWalker, tgzWalker archive.WalkFn) Identifier
type MatchFunc ¶
MatchFunc is used to match a file for processing. If returning a positive finding, a file will be passed onto the ProcessFunc.
type ProcessFunc ¶
type ProcessFunc func(ctx context.Context, path string, d fs.DirEntry, result Finding, version Versions)
ProcessFunc processes the given matched file.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.