Documentation
¶
Overview ¶
Package common provides generic utilities used by multiple catalogers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenericCataloger ¶
type GenericCataloger struct {
// contains filtered or unexported fields
}
GenericCataloger implements the Catalog interface and is responsible for dispatching the proper parser function for a given path or glob pattern. This is intended to be reusable across many package cataloger types.
func NewGenericCataloger ¶
func NewGenericCataloger(pathParsers map[string]ParserFn, globParsers map[string]ParserFn) GenericCataloger
NewGenericCataloger if provided path-to-parser-function and glob-to-parser-function lookups creates a GenericCataloger
func (*GenericCataloger) Catalog ¶
func (a *GenericCataloger) Catalog(contents map[file.Reference]string, upstreamMatcher string) ([]pkg.Package, error)
Catalog takes a set of file contents and uses any configured parser functions to resolve and return discovered packages
func (*GenericCataloger) SelectFiles ¶
func (a *GenericCataloger) SelectFiles(resolver scope.FileResolver) []file.Reference
SelectFiles takes a set of file trees and resolves and file references of interest for future cataloging