folder

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 14 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 {
	Role    types.AdapterRole // "input" or "output" adapter type
	Fetcher SBOMFetcher
	// contains filtered or unexported fields
}

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) 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
}

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

func (it *FolderIterator) Next(ctx context.Context) (*iterator.SBOM, error)

Next retrieves the next SBOM in the iteration

type FolderReporter

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

func NewFolderReporter

func NewFolderReporter(verbose bool, outputDir string) *FolderReporter

func (*FolderReporter) DryRun

type ParallelFetcher

type ParallelFetcher struct{}

func (*ParallelFetcher) Fetch

ParallelFetcher Fetch() scans the folder for SBOMs using parallel processing 1. Walks through the folder file-by-file. 2. Launch a goroutine for each file. 3. Detects valid SBOMs using source.IsSBOMFile(). 4. Uses channels to store SBOMs & errors. 5. Reads the content & adds it to the iterator along with path.

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.

Jump to

Keyboard shortcuts

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