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, upstreamCataloger string, postProcessors ...PostProcessFunc) *GenericCataloger
NewGenericCataloger if provided path-to-parser-function and glob-to-parser-function lookups creates a GenericCataloger
func (*GenericCataloger) Catalog ¶
func (c *GenericCataloger) Catalog(resolver source.FileResolver) ([]pkg.Package, []artifact.Relationship, error)
Catalog is given an object to resolve file references and content, this function returns any discovered Packages after analyzing the catalog source.
func (*GenericCataloger) Name ¶
func (c *GenericCataloger) Name() string
Name returns a string that uniquely describes the upstream cataloger that this Generic Cataloger represents.
type ParserFn ¶
ParserFn standardizes a function signature for parser functions that accept the virtual file path (not usable for file reads) and contents and return any discovered packages from that file