Documentation
¶
Index ¶
Constants ¶
const ( NothingDetected Finding = 0 ClassName = 1 << iota JarName = 1 << iota JarNameInsideArchive = 1 << iota ClassPackageAndName = 1 << iota )
const (
UnknownVersion = "unknown"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveFileLister ¶
ArchiveFileLister lists the files contained within an archive.
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 the given filesystem, fSys, from the root of it. Each file will be passed to the math function, which should return true if the path should then be processed by the process function. On encountering a directory, the path will be compared against all IgnoreDirs configured in the Crawler. If any pattern matches, all files nested inside the directory will be ignored.
type Identifier ¶
type Identifier interface {
Identify(ctx context.Context, path string, d fs.DirEntry) (Finding, string, error)
}
func NewIdentifier ¶
func NewIdentifier(archiveListTimeout time.Duration, zipLister, tgzLister ArchiveFileLister) 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 string)
ProcessFunc processes the given matched file.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}