licensing

package
v0.0.0-...-a89fe16 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const LicenseFilePrefix = "file://"

Variables

This section is empty.

Functions

func SPDXLicenseID

func SPDXLicenseID(name string) (string, bool)

SPDXLicenseID maps a license name to its SPDX identifier.

func SPDXLicenseIDByURL

func SPDXLicenseIDByURL(url string) (string, bool)

SPDXLicenseIDByURL maps a license URL to its SPDX identifier. An unresolved URL returns ("", false). All case values are lowercase because the input is lowercased before comparison.

func SplitLicenses

func SplitLicenses(s string) []string

SplitLicenses splits a license string into individual license names. It handles separators like ",", "or", "and" as standalone words (not when followed by "later" which is part of a version specification).

Types

type LicenseFileNames

type LicenseFileNames struct{}

LicenseFileNames is the set of license file name stems that qualify as license files.

func (LicenseFileNames) Contains

func (LicenseFileNames) Contains(stem string) bool

Contains reports whether stem is a known license file name stem.

type LicenseFinding

type LicenseFinding struct {
	Findings findings
}

LicenseFinding is the result of classifying a license file.

func Classify

func Classify(name string, file io.Reader, confidenceLevel float64) (*LicenseFinding, error)

Classify examines a file's name and content to detect its license.

Jump to

Keyboard shortcuts

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