cataloger

package
v0.46.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package cataloger provides the ability to process files from a container image or file system and discover packages (gems, wheels, jars, rpms, debs, etc). Specifically, this package contains both a catalog function to utilize all catalogers defined in child packages as well as the interface definition to implement a cataloger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Catalog

func Catalog(resolver source.FileResolver, release *linux.Release, catalogers ...Cataloger) (*pkg.Catalog, []artifact.Relationship, error)

Catalog a given source (container image or filesystem) with the given catalogers, returning all discovered packages. In order to efficiently retrieve contents from a underlying container image the content fetch requests are done in bulk. Specifically, all files of interest are collected from each catalogers and accumulated into a single request.

Types

type Cataloger

type Cataloger interface {
	// Name returns a string that uniquely describes a cataloger
	Name() string
	// Catalog is given an object to resolve file references and content, this function returns any discovered Packages after analyzing the catalog source.
	Catalog(resolver source.FileResolver) ([]pkg.Package, []artifact.Relationship, error)
}

Cataloger describes behavior for an object to participate in parsing container image or file system contents for the purpose of discovering Packages. Each concrete implementation should focus on discovering Packages for a specific Package Type or ecosystem.

func AllCatalogers added in v0.30.0

func AllCatalogers(cfg Config) []Cataloger

AllCatalogers returns all implemented catalogers

func DirectoryCatalogers

func DirectoryCatalogers(cfg Config) []Cataloger

DirectoryCatalogers returns a slice of locally implemented catalogers that are fit for detecting packages from index files (and select installations)

func ImageCatalogers

func ImageCatalogers(cfg Config) []Cataloger

ImageCatalogers returns a slice of locally implemented catalogers that are fit for detecting installations of packages.

type Config added in v0.35.0

type Config struct {
	Search SearchConfig
}

func DefaultConfig added in v0.35.0

func DefaultConfig() Config

func (Config) Java added in v0.35.0

func (c Config) Java() java.Config

type Monitor

type Monitor struct {
	FilesProcessed     progress.Monitorable // the number of files selected and contents analyzed from all registered catalogers
	PackagesDiscovered progress.Monitorable // the number of packages discovered from all registered catalogers
}

Monitor provides progress-related data for observing the progress of a Catalog() call (published on the event bus).

type SearchConfig added in v0.35.0

type SearchConfig struct {
	IncludeIndexedArchives   bool
	IncludeUnindexedArchives bool
	Scope                    source.Scope
}

func DefaultSearchConfig added in v0.35.0

func DefaultSearchConfig() SearchConfig

Directories

Path Synopsis
Package apkdb provides a concrete Cataloger implementation for Alpine DB files.
Package apkdb provides a concrete Cataloger implementation for Alpine DB files.
Package common provides generic utilities used by multiple catalogers.
Package common provides generic utilities used by multiple catalogers.
cpe
Package dpkg provides a concrete Cataloger implementation for Debian package DB status files.
Package dpkg provides a concrete Cataloger implementation for Debian package DB status files.
Package golang provides a concrete Cataloger implementation for go.mod files.
Package golang provides a concrete Cataloger implementation for go.mod files.
internal/xcoff
nolint //this is an internal golang lib nolint // this is an internal golang lib
nolint //this is an internal golang lib nolint // this is an internal golang lib
Package java provides a concrete Cataloger implementation for Java archives (jar, war, ear, par, sar, jpi, hpi formats).
Package java provides a concrete Cataloger implementation for Java archives (jar, war, ear, par, sar, jpi, hpi formats).
Package javascript provides a concrete Cataloger implementation for JavaScript ecosystem files (yarn and npm).
Package javascript provides a concrete Cataloger implementation for JavaScript ecosystem files (yarn and npm).
Package php provides a concrete Cataloger implementation for PHP ecosystem files.
Package php provides a concrete Cataloger implementation for PHP ecosystem files.
Package python provides a concrete Cataloger implementation for Python ecosystem files (egg, wheel, requirements.txt).
Package python provides a concrete Cataloger implementation for Python ecosystem files (egg, wheel, requirements.txt).
Package rpmdb provides a concrete Cataloger implementation for RPM "Package" DB files.
Package rpmdb provides a concrete Cataloger implementation for RPM "Package" DB files.
Package ruby bundler provides a concrete Cataloger implementation for Ruby Gemfile.lock bundler files.
Package ruby bundler provides a concrete Cataloger implementation for Ruby Gemfile.lock bundler files.
Package rust provides a concrete Cataloger implementation for Cargo.lock files.
Package rust provides a concrete Cataloger implementation for Cargo.lock files.

Jump to

Keyboard shortcuts

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