Documentation
¶
Index ¶
- Variables
- type Decomposer
- func (d *Decomposer) Extract(opts *api.DecomposerOptions) (*sbom.NodeList, error)
- func (d *Decomposer) ExtractWithContext(ctx context.Context, _ *api.DecomposerOptions) (*sbom.NodeList, error)
- func (d *Decomposer) IndexFS(source fs.FS) (*sbom.NodeList, error)
- func (d *Decomposer) IndexFSWithContext(ctx context.Context, source fs.FS) (*sbom.NodeList, error)
- type FileProcessor
- type FileProcessorFactory
Constants ¶
This section is empty.
Variables ¶
var FileProcessors = map[string]FileProcessorFactory{ "hash": func() FileProcessor { return processors.NewHasher() }, "license": func() FileProcessor { return processors.NewLicenseScanner() }, }
FileProcessors is the list of available file processor factories. Each call produces a fresh instance to avoid shared mutable state.
Functions ¶
This section is empty.
Types ¶
type Decomposer ¶
type Decomposer struct {
Options options.Options
Processors []FileProcessor
}
Decomposer is a filesystem indexer
func (*Decomposer) Extract ¶
func (d *Decomposer) Extract(opts *api.DecomposerOptions) (*sbom.NodeList, error)
Extract reads and hashes the files from the filesystem
func (*Decomposer) ExtractWithContext ¶ added in v0.4.1
func (d *Decomposer) ExtractWithContext(ctx context.Context, _ *api.DecomposerOptions) (*sbom.NodeList, error)
ExtractWithContext is Extract, run with the caller's context.
func (*Decomposer) IndexFS ¶
IndexFS takes an fs.FS and returns a nodelist with all the files indexed and enriched by the configured processors.
func (*Decomposer) IndexFSWithContext ¶ added in v0.4.1
IndexFSWithContext is IndexFS, run with the caller's context, whose logger it reports to.
type FileProcessor ¶
type FileProcessorFactory ¶ added in v0.1.1
type FileProcessorFactory func() FileProcessor
FileProcessorFactory is a function that creates a new FileProcessor instance.