Documentation
¶
Index ¶
- Constants
- func Classify(filePath string, r io.Reader, confidenceLevel float64) (*types.LicenseFile, error)
- func LaxSplitLicenses(str string) []string
- func Normalize(name string) string
- func NormalizeLicense(exp expr.Expression) expr.Expression
- func SplitLicenses(str string) []string
- func TrimLicenseText(text string) string
- type Scanner
- type ScannerOption
Constants ¶
View Source
const ( LicenseTextPrefix = "text://" LicenseFilePrefix = "file://" CustomLicensePrefix = "CUSTOM License" )
Variables ¶
This section is empty.
Functions ¶
func LaxSplitLicenses ¶ added in v0.56.0
Split license string considering spaces as separator e.g. MPL 2.0 GPL2+ => {"MPL2.0", "GPL2+"}
func NormalizeLicense ¶ added in v0.56.0
func NormalizeLicense(exp expr.Expression) expr.Expression
func SplitLicenses ¶ added in v0.44.0
func TrimLicenseText ¶ added in v0.56.0
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func NewScanner ¶
func NewScanner(categories map[types.LicenseCategory][]string) Scanner
func (*Scanner) ScanTextLicense ¶ added in v0.63.0
func (s *Scanner) ScanTextLicense(licenseText string) (types.LicenseCategory, string)
ScanTextLicense checks license names from `categories` as glob patterns and matches licenseText against those patterns. If a match is found, it returns `unknown` category and severity.
type ScannerOption ¶
type ScannerOption struct {
IgnoredLicenses []string
LicenseCategories map[types.LicenseCategory][]string
}
Click to show internal directories.
Click to hide internal directories.