dependencies

package
v0.1.0-pre2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	FailOnSingleMulti: true,
	ReadGitVersion:    true,
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Options

type Options struct {
	// FailOnSingleMulti makes Unpacker return an error on calls that return a
	// single nodelist but obtain more than one from the configured decomposers.
	// This can happen when a directory contains code for more than one language
	// or multiple projects in the same directory.
	//
	// By default this is on as turning it off causes unpacker to behave in a
	// non-deterministic way as it can return diferent data depending on the
	// order of the configured decomposers
	FailOnSingleMulti bool

	// IndexFiles instructs the unpacker to add all files to the resulting
	// nodelist after running source decomposers in a directory. This runs
	// the file decomposer indexer which will hash all files in the source
	// directory.
	IndexFiles bool

	// ReadGitVersion instructs the unpacker to read the current version from
	// the git history and pass it to the decomposers to use as the version
	// for the root nodes.
	ReadGitVersion bool
	// contains filtered or unexported fields
}

type Sources

type Sources struct {
	Paths     []string
	Artifacts []string
}

type Unpacker

type Unpacker struct {
	Options Options
	// contains filtered or unexported fields
}

Unpacker is the main tool to extract dependency data

func NewUnpacker

func NewUnpacker() *Unpacker

func (*Unpacker) Extract

func (unpacker *Unpacker) Extract(sources Sources) ([]*sbom.NodeList, error)

Extract is an alias of ExtractWithContext without context support

func (*Unpacker) ExtractArtifact

func (unpacker *Unpacker) ExtractArtifact(path string) (*sbom.NodeList, error)

ExtractFromCodeBaseWithContext

func (*Unpacker) ExtractArtifactWithContext

func (unpacker *Unpacker) ExtractArtifactWithContext(ctx context.Context, path string) (*sbom.NodeList, error)

ExtractCodeBaseWithContext extracts data from a single directory.

func (*Unpacker) ExtractCodebase

func (unpacker *Unpacker) ExtractCodebase(path string) (*sbom.NodeList, error)

ExtractFromCodeBaseWithContext

func (*Unpacker) ExtractCodebaseWithContext

func (unpacker *Unpacker) ExtractCodebaseWithContext(ctx context.Context, path string) (*sbom.NodeList, error)

ExtractCodeBaseWithContext extracts data from a single directory.

func (*Unpacker) ExtractWithContext

func (unpacker *Unpacker) ExtractWithContext(ctx context.Context, sources Sources) ([]*sbom.NodeList, error)

ExtractWithContext launches the analyzers in the configured sources and returns resulting nodelists.

func (*Unpacker) RegisterDecomposer

func (unpacker *Unpacker) RegisterDecomposer(d api.Decomposer)

func (*Unpacker) UnregisterDecomposer

func (unpacker *Unpacker) UnregisterDecomposer(d api.Decomposer)

Jump to

Keyboard shortcuts

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