license

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MulanPSL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CDDL1AndGPL1           = "cddl+gpl_1_1"
	NONE_LICENSE           = "NONE"
	NOASSERTION_LICENSE    = "NOASSERTION"
	ConfidenceMinimumValue = float32(0.9)

	CopyrightFileName = "copyright"
)

Functions

func CreateLicenseExpression

func CreateLicenseExpression(licenses []string) string

func EnsureSingleLicense

func EnsureSingleLicense(name string) string

func GetLicenseByZipFile

func GetLicenseByZipFile(filePath string) []string

func GetLicensesFromCopyright

func GetLicensesFromCopyright(reader io.Reader) []string

func ParseLicenseFromContent

func ParseLicenseFromContent(content string) (value, other string, exists bool)

ParseLicenseFromContent parses the license content and returns the license ID.

func ParseLicenseFromDir

func ParseLicenseFromDir(path string) (value []string, other string, exists bool)

ParseLicenseFromDir parses the license from the directory and returns the license ID.

func ParseLicenseName

func ParseLicenseName(key string) (value, other string, exists bool)

ParseLicenseName parses the license name and returns the license ID.

func ParseLicenseURL

func ParseLicenseURL(key string) (value, other string, exists bool)

ParseLicenseURL parses the license url and returns the license ID. licenseLowercaseKeys is a map of lowercase license names to license IDs.

func SplitLicense

func SplitLicense(key string, licenseList []string) []string

SplitLicense splits the license string and returns the license ID.

func UniqueStrings

func UniqueStrings(strs []string) []string

UniqueStrings returns the unique strings.

Types

type LicenseGuess

type LicenseGuess struct {
	Name       string
	Confidence float32
}

Jump to

Keyboard shortcuts

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