license

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Unknown license type.
	Unknown = Type("")
	// Restricted licenses require mandatory source distribution if we ship a
	// product that includes third-party code protected by such a license.
	Restricted = Type("restricted")
	// Reciprocal licenses allow usage of software made available under such
	// licenses freely in *unmodified* form. If the third-party source code is
	// modified in any way these modifications to the original third-party
	// source code must be made available.
	Reciprocal = Type("reciprocal")
	// Notice licenses contain few restrictions, allowing original or modified
	// third-party software to be shipped in any product without endangering or
	// encumbering our source code. All of the licenses in this category do,
	// however, have an "original Copyright notice" or "advertising clause",
	// wherein any external distributions must include the notice or clause
	// specified in the license.
	Notice = Type("notice")
	// Permissive licenses are even more lenient than a 'notice' license.
	// Not even a copyright notice is required for license compliance.
	Permissive = Type("permissive")
	// Unencumbered covers licenses that basically declare that the code is "free for any use".
	Unencumbered = Type("unencumbered")
	// Forbidden licenses are forbidden to be used.
	Forbidden = Type("FORBIDDEN")
)

License types Thank you https://github.com/google/go-licenses

Variables

This section is empty.

Functions

func InitHandler

func InitHandler(lgr logger.Logger) *handler

InitHandler initializes handler of licenses

Types

type Handler

type Handler interface {
	FindLicense(dir string) License
	InitializeClassifier() output.Output
}

Handler handles functions related to license identification

type License

type License struct {
	Hash string
	Name string
	Path string
	Type Type
}

License software license details.

func (License) Found

func (lic License) Found() bool

Found checks by hash if a license was found

func (License) IsCritical added in v0.7.0

func (lic License) IsCritical() bool

IsCritical checks if license has critical restrictions

func (License) IsMoreRestrictive

func (lic License) IsMoreRestrictive(nTp Type) bool

IsMoreRestrictive defines if license if more restrictions comparing licenses types

type Type

type Type string

Type identifies a class of software license.

Jump to

Keyboard shortcuts

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