module

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToComponent

func ToComponent(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(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(gomod.Module, *cdx.Component) error

func WithComponentType

func WithComponentType(ctype cdx.ComponentType) Option

WithComponentType overrides the type of the component.

func WithFiles

func WithFiles(enabled bool) Option

func WithLicenses

func WithLicenses(enabled bool) Option

WithLicenses attempts to resolve licenses for the module and attach them to the component's license evidence.

func WithModuleHashes

func WithModuleHashes() 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