folder

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FolderAdapter

type FolderAdapter struct {
	Config  *FolderConfig
	Role    types.AdapterRole // "input" or "output" adapter type
	Fetcher SBOMFetcher
}

FolderAdapter handles fetching SBOMs from folders

func (*FolderAdapter) AddCommandParams

func (f *FolderAdapter) AddCommandParams(cmd *cobra.Command)

AddCommandParams adds Folder-specific CLI flags

func (*FolderAdapter) DryRun

DryRun for Folder Adapter: Displays all fetched SBOMs from folder adapter

func (*FolderAdapter) FetchSBOMs

FetchSBOMs initializes the Folder SBOM iterator using the unified method

func (*FolderAdapter) Monitor added in v0.0.3

func (*FolderAdapter) ParseAndValidateParams

func (f *FolderAdapter) ParseAndValidateParams(cmd *cobra.Command) error

ParseAndValidateParams validates the Folder adapter params

func (*FolderAdapter) UploadSBOMs

func (f *FolderAdapter) UploadSBOMs(ctx tcontext.TransferMetadata, iterator iterator.SBOMIterator) error

OutputSBOMs should return an error since Folder does not support SBOM uploads

type FolderConfig

type FolderConfig struct {
	FolderPath     string
	Recursive      bool
	ProcessingMode types.ProcessingMode
	Daemon         bool
}

func NewFolderConfig

func NewFolderConfig() *FolderConfig

type FolderIterator

type FolderIterator struct {
	// contains filtered or unexported fields
}

FolderIterator iterates over SBOMs found in a folder

func NewFolderIterator

func NewFolderIterator(sboms []*iterator.SBOM) *FolderIterator

NewFolderIterator initializes and returns a new FolderIterator

func (*FolderIterator) Next

Next retrieves the next SBOM in the iteration

type FolderReporter

type FolderReporter struct {
	// contains filtered or unexported fields
}

func NewFolderReporter

func NewFolderReporter(verbose bool, inputDir, folderPath string) *FolderReporter

func (*FolderReporter) DryRun

type ParallelFetcher

type ParallelFetcher struct{}

func (*ParallelFetcher) Fetch

Fetch scans the folder for SBOMs concurrently. It walks through the directory to collect file paths, then spawns a fixed number of worker goroutines to read and process those files concurrently.

type SBOMFetcher

type SBOMFetcher interface {
	Fetch(ctx tcontext.TransferMetadata, config *FolderConfig) (iterator.SBOMIterator, error)
}

type SequentialFetcher

type SequentialFetcher struct{}

func (*SequentialFetcher) Fetch

SequentialFetcher Fetch() scans the folder for SBOMs one-by-one 1. Walks through the folder file-by-file 2. Detects valid SBOMs using source.IsSBOMFile(). 3. Reads the content & adds it to the iterator along with path.

type WatcherFetcher added in v0.0.3

type WatcherFetcher struct{}

func NewWatcherFetcher added in v0.0.3

func NewWatcherFetcher() *WatcherFetcher

func (*WatcherFetcher) Fetch added in v0.0.3

type WatcherIterator added in v0.0.3

type WatcherIterator struct {
	// contains filtered or unexported fields
}

watchiterator collects sbom on the real time via channel

func (*WatcherIterator) Next added in v0.0.3

Jump to

Keyboard shortcuts

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