golang

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decomposer

type Decomposer struct{}

func New

func New() *Decomposer

func (*Decomposer) DefaultOptions

func (d *Decomposer) DefaultOptions() any

func (*Decomposer) Extract

func (d *Decomposer) Extract(opts *api.DecomposerOptions) (*sbom.NodeList, error)

Extract parses the local go.mod file, fetches dependency information from the Go module proxy, and builds the complete dependency graph as a protobom NodeList.

func (*Decomposer) FindCodeBases

func (d *Decomposer) FindCodeBases(index *code.PathIndex) ([]string, error)

func (*Decomposer) Requirements

func (d *Decomposer) Requirements(_ *api.DecomposerOptions) []api.Requirement

Requirements returns the requirements for the decomposer. No external binary required - uses pure Go implementation.

type Options

type Options struct {
	IncludeGo   bool
	ProxyURL    string       // default: https://proxy.golang.org
	HTTPClient  *http.Client // allow HTTP custom client for testing
	Concurrency int          // number of parallel HTTP requests (default: 10)

	// PreferModuleCache reads dependency go.mod files from the local Go
	// module cache before asking the proxy. The cache holds a copy the
	// go command has already verified against go.sum, so the data is the
	// same, but the proxy stays authoritative unless this is set.
	PreferModuleCache bool
}

Options configures the Go dependency extraction

Jump to

Keyboard shortcuts

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