filesystem

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileProcessors = map[string]FileProcessorFactory{
	"hash": func() FileProcessor { return processors.NewHasher() },
}

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