utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsLicense

func ContainsLicense(spdxLicenseExpression string, disallowed string) bool

returns true if the licenseExpression contains the disallowed license this implements a whole word match

Types

type PackageInfo

type PackageInfo struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

type PackageLicense

type PackageLicense struct {
	Name    string
	Version string
	License string
}

Internal types that stores extracted SBOM information "name": "alpine-baselayout", "SPDXID": "SPDXRef-Package-apk-alpine-baselayout-92b19c7750fb559d", "versionInfo": "3.4.0-r0", "originator": "Person: Natanael Copa \u003cncopa@alpinelinux.org\u003e", "downloadLocation": "https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout", "sourceInfo": "acquired package info from APK DB: /lib/apk/db/installed", "licenseConcluded": "GPL-2.0-only", This will translate to a PackageLicense obj with the following fields: Name: alpine-baselayout Version: 3.4.0-r0 License: GPL-2.0-only (maps to licenseConcluded)

func GetPackageLicenses

func GetPackageLicenses(doc spdx.Document) []PackageLicense

Get the packageLicense array from spdxDoc

Jump to

Keyboard shortcuts

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