iterator

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryIterator

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

MemoryIterator is an iterator that iterates over a preloaded slice of SBOMs.

func NewMemoryIterator

func NewMemoryIterator(sboms []*SBOM) *MemoryIterator

NewMemoryIterator creates a new MemoryIterator from a slice of SBOMs.

func (*MemoryIterator) Next

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

Next retrieves the next SBOM in memory.

type SBOM

type SBOM struct {
	Path      string // File path (empty if stored in memory)
	Data      []byte // SBOM data stored in memory (nil if using Path)
	Namespace string // It could be Repo, or Dir (helps track multi-repo or multi-folder processing)
	Version   string // Version of the SBOM (e.g., "latest" or "v1.2.3")
	Branch    string // github repo main, master, or any specific branch
}

SBOM represents a single SBOM file

type SBOMIterator

type SBOMIterator interface {
	Next(ctx context.Context) (*SBOM, error) // Fetch the next SBOM
}

SBOMIterator provides a way to lazily fetch SBOMs one by one

Jump to

Keyboard shortcuts

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