licensing

package
v0.57.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
const (
	LicenseTextPrefix   = "text://"
	LicenseFilePrefix   = "file://"
	CustomLicensePrefix = "CUSTOM License"
)

Variables

This section is empty.

Functions

func Classify

func Classify(filePath string, r io.Reader, confidenceLevel float64) (*types.LicenseFile, error)

Classify detects and classifies the license found in a file

func LaxSplitLicenses added in v0.56.0

func LaxSplitLicenses(str string) []string

Split license string considering spaces as separator e.g. MPL 2.0 GPL2+ => {"MPL2.0", "GPL2+"}

func Normalize

func Normalize(name string) string

func NormalizeLicense added in v0.56.0

func NormalizeLicense(name string) expr.SimpleExpr

func SplitLicenses added in v0.44.0

func SplitLicenses(str string) []string

func TrimLicenseText added in v0.56.0

func TrimLicenseText(text string) string

Types

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(categories map[types.LicenseCategory][]string) Scanner

func (*Scanner) Scan

func (s *Scanner) Scan(licenseName string) (types.LicenseCategory, string)

type ScannerOption

type ScannerOption struct {
	IgnoredLicenses   []string
	LicenseCategories map[types.LicenseCategory][]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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