module

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToComponent

func ToComponent(logger zerolog.Logger, module gomod.Module, options ...Option) (*cdx.Component, error)

ToComponent converts a gomod.Module to a CycloneDX component. The component can be further customized using options, before it's returned.

func ToComponents

func ToComponents(logger zerolog.Logger, modules []gomod.Module, options ...Option) ([]cdx.Component, error)

ToComponents converts a slice of gomod.Module to a slice of CycloneDX components.

Types

type Option

type Option func(zerolog.Logger, gomod.Module, *cdx.Component) error

func WithComponentType

func WithComponentType(ctype cdx.ComponentType) Option

WithComponentType overrides the type of the component.

func WithLicenses

func WithLicenses(detector licensedetect.Detector) Option

WithLicenses attempts to detect licenses for the module using a provided license detector and attach them to the component's license evidence.

func WithModuleHashes

func WithModuleHashes() Option

func WithPackages added in v1.1.0

func WithPackages(enabled bool, options ...pkgConv.Option) Option

func WithScope

func WithScope(scope cdx.Scope) Option

WithScope overrides the scope of the component.

func WithTestScope

func WithTestScope(scope cdx.Scope) Option

WithTestScope overrides the scope of the component, if the corresponding module has the TestOnly flag set.

Jump to

Keyboard shortcuts

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