mod

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Package mod provides the functionality to generate SBOMs for modules.

Please refer to the CLI documentation for further details about this mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGenerator

func NewGenerator(moduleDir string, opts ...Option) (generate.Generator, error)

NewGenerator returns a generator that is capable of generating BOMs for Go modules.

Types

type Option

type Option func(g *generator) error

Option allows for customization of the generator using the functional options pattern.

func WithComponentType

func WithComponentType(ctype cdx.ComponentType) Option

WithComponentType overrides the type of the main component. Default is ComponentTypeApplication.

func WithIncludeStdlib

func WithIncludeStdlib(enable bool) Option

WithIncludeStdlib toggles the inclusion of a std component representing the Go standard library in the generated BOM.

When enabled, the std component will be represented as a direct dependency of the main module.

func WithIncludeTestModules

func WithIncludeTestModules(enable bool) Option

WithIncludeTestModules toggles the inclusion of test-only modules.

func WithLicenseDetector

func WithLicenseDetector(detector licensedetect.Detector) Option

WithLicenseDetector sets the license detector.

When nil, no license detection will be performed. Default is nil.

func WithLogger

func WithLogger(logger zerolog.Logger) Option

WithLogger overrides the default logger of the generator.

Jump to

Keyboard shortcuts

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