filesystem

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 New

func New(funcs ...options.Function) (*Decomposer, error)

func (*Decomposer) Extract

Extract reads and hashes the files from the filesystem

func (*Decomposer) IndexFS

func (d *Decomposer) IndexFS(source fs.FS) (*sbom.NodeList, error)

IndexFS takes an fs.FS and returns a nodelist with all the files indexed and enriched by the configured processors.

type FileProcessor

type FileProcessor interface {
	Process(*options.Options, fs.FS, *sbom.Node) error
}

type FileProcessorFactory added in v0.1.1

type FileProcessorFactory func() FileProcessor

FileProcessorFactory is a function that creates a new FileProcessor instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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