Versions in this module Expand all Collapse all v0 v0.1.1 Feb 27, 2026 v0.1.0 Jan 18, 2026 Changes in this version + var ErrEmptyExpression = errors.New("empty expression") + var ErrInvalidException = errors.New("invalid exception identifier") + var ErrInvalidLicense = errors.New("invalid license") + var ErrInvalidLicenseID = errors.New("invalid license identifier") + var ErrInvalidSpecialValue = errors.New("NONE and NOASSERTION must be standalone") + var ErrMissingOperand = errors.New("missing operand") + var ErrUnbalancedParens = errors.New("unbalanced parentheses") + var ErrUnexpectedToken = errors.New("unexpected token") + func ExtractLicenses(expression string) ([]string, error) + func HasCopyleft(expression string) bool + func IsCommercial(license string) bool + func IsCopyleft(license string) bool + func IsFullyPermissive(expression string) bool + func IsPermissive(license string) bool + func Normalize(license string) (string, error) + func NormalizeExpression(expression string) (string, error) + func NormalizeExpressionLax(expression string) (string, error) + func Satisfies(expression string, allowed []string) (bool, error) + func Valid(expression string) bool + func ValidLicense(license string) bool + func ValidateLicenses(licenses []string) (bool, []string) + type AndExpression struct + Left Expression + Right Expression + func (e *AndExpression) Licenses() []string + func (e *AndExpression) String() string + type Category string + const CategoryCLA + const CategoryCommercial + const CategoryCopyleft + const CategoryCopyleftLimited + const CategoryFreeRestricted + const CategoryPatentLicense + const CategoryPermissive + const CategoryProprietaryFree + const CategoryPublicDomain + const CategorySourceAvailable + const CategoryUnknown + const CategoryUnstated + func ExpressionCategories(expression string) ([]Category, error) + func LicenseCategory(license string) Category + type Expression interface + Licenses func() []string + String func() string + func Parse(expression string) (Expression, error) + func ParseLax(expression string) (Expression, error) + func ParseStrict(expression string) (Expression, error) + type License struct + Exception string + ID string + Plus bool + func (l *License) Licenses() []string + func (l *License) String() string + type LicenseError struct + Err error + License string + func (e *LicenseError) Error() string + func (e *LicenseError) Unwrap() error + type LicenseInfo struct + Category Category + IsDeprecated bool + IsException bool + Key string + SPDXKey string + func GetLicenseInfo(license string) *LicenseInfo + type LicenseRef struct + DocumentRef string + LicenseRef string + func (l *LicenseRef) Licenses() []string + func (l *LicenseRef) String() string + type OrExpression struct + Left Expression + Right Expression + func (e *OrExpression) Licenses() []string + func (e *OrExpression) String() string + type SpecialValue struct + Value string + func (s *SpecialValue) Licenses() []string + func (s *SpecialValue) String() string