common

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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

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

type ParserFn func(string, io.Reader) ([]*pkg.Package, []artifact.Relationship, error)

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

type PostProcessFunc

type PostProcessFunc func(resolver source.FileResolver, location source.Location, p *pkg.Package) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL